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

feat: use new intermediate block change event for field edits, normal block change event for closing editor. #7105 #7151

Merged
merged 9 commits into from
Jun 16, 2023

Conversation

johnnesky
Copy link
Member

Another proposal to fix #2496. Creates a new event type specifically for intermediate field value changes, which is not recorded in undo history. Inhibits firing normal block change events for field value edits when triggered via a user input widget, and instead broadcasts this new event type. When the input widget is disposed, then a standard block change event will be fired with an oldValue corresponding to what the field's value was when the widget was opened.

Compare with: #7064 and #7105

Unlike #7105 this version of the new event type inherits from BlockBase instead of UiBase. The difference is minor and only affects one file: events_block_field_intermediate_change.ts

Copy link
Collaborator

@BeksOmega BeksOmega left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the incredible amount of work on this John!! Just a few comments about inline comments, then LGTM =)

core/events/events_block_field_intermediate_change.ts Outdated Show resolved Hide resolved
core/field.ts Outdated Show resolved Hide resolved
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add this change in samples as well? Since we're migrating the angle field over there (we're leaving it in both places for a month or two to give people time to transition).

If not I can grab this since I'm testing samples this quarter anyway =)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably not until this is committed and blockly-samples depends on the latest version, but I created an issue to do so: google/blockly-samples#1717

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: feature Adds a feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make onFinishEditing_ Better
3 participants