Skip to content

Conversation

@maribethb
Copy link
Collaborator

Fixes RaspberryPiFoundation/blockly#9101

Depends on RaspberryPiFoundation/blockly#9110

Adds a check to the canCurrentlyNavigate function to make sure nothing has ephemeral focus.

This is safe to do because this function is only used by action preconditions.

It's even safe to do for the escape shortcut because that shortcut only applies when the flyout or toolbox is opened, and in that case it's not possible for a field editor to be open. The escape shortcut in core is the one that closes chaff generally (e.g. when field editors are open) and that one does not have this precondition, so it can still be used to close field editors.

@maribethb maribethb requested a review from a team as a code owner May 30, 2025 00:34
@maribethb maribethb requested review from BenHenning and removed request for a team May 30, 2025 00:34
Copy link
Collaborator

@BenHenning BenHenning left a comment

Choose a reason for hiding this comment

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

Thanks @maribethb, LGTM! Just had one comment that might lead to a slight test simplification.

Comment on lines 125 to 127
await this.browser.keys(Key.Ctrl);
await this.browser.keys('x');
await this.browser.keys(Key.Ctrl); // release ctrl key
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you just use await this.browser.keys([Key.Ctrl, 'x']); instead? I think we do that elsewhere.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oh, I guess so. The webdriver documentation includes a very confusing statement that modifier keys will be considered held down until you trigger them again, but then their example with copy and paste doesn't do anything related to that, so... I guess it's fine.

This was referenced May 30, 2025
@maribethb maribethb merged commit c9465bb into RaspberryPiFoundation:main May 30, 2025
12 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Keyboard shortcuts handled with the wrong scope

2 participants