Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected child block disconection when changing a field option #6801

Closed
1 task done
gpfernandezflorio opened this issue Jan 27, 2023 · 3 comments
Closed
1 task done
Labels
issue: bug Describes why the code or behaviour is wrong

Comments

@gpfernandezflorio
Copy link
Contributor

Check for Duplicates

  • I have searched for similar issues before opening a new one.

Description

When changing the field WHERE of the block text_charAt the child block in the input AT gets disconnected.
image
image
This only happends with text_charAt but it doesn't happen with text_getSubstring, lists_getIndex and lists_getSublist.

Reproduction Steps

  1. Create a text_charAt block
  2. Fill it's input AT
  3. Change the field WHERE to "letter # from end"

Stack Trace

No response

Screenshots

No response

Browsers

Chrome desktop

@gpfernandezflorio gpfernandezflorio added the issue: triage Issues awaiting triage by a Blockly team member label Jan 27, 2023
@cpcallen cpcallen added issue: bug Describes why the code or behaviour is wrong and removed issue: triage Issues awaiting triage by a Blockly team member labels Jan 30, 2023
@cpcallen cpcallen added this to the Bug Bash Backlog milestone Jan 30, 2023
@cpcallen
Copy link
Contributor

cpcallen commented Jan 30, 2023

Confirmed in develop.

Yes, this indeed seems like a bug! I suspect the problem is that some of the items in the dropdown remove the input completely, and this is probably being done when switching between "letter #" and "letter # from end" even though it appears not to be necessary in that particular case.

@gpfernandezflorio
Copy link
Contributor Author

I saw that and suspected the same but the fact that it doesn't happen with the other blocks (text_getSubstring, lists_getIndex and lists_getSublist) makes me doubt.

Changing the function so the input is only removed when it is not necessary does indeed fix the problem. The question is why the other blocks don't need that. I couldn't find what else is different and also, I don't understand how the child block is maintained after a change (in the code I only see the input being removed and then added again but nothing about the child block being reconnected to the new input).

@BeksOmega BeksOmega self-assigned this Mar 20, 2023
@BeksOmega BeksOmega removed their assignment Apr 4, 2023
@gonfunko
Copy link
Contributor

This no longer repros and may have been fixed by #8575.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue: bug Describes why the code or behaviour is wrong
Projects
None yet
Development

No branches or pull requests

4 participants