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

fix: update keyboard nav to use proper getContents #2342

Merged
merged 5 commits into from
May 13, 2024

Conversation

maribethb
Copy link
Contributor

The basics

The details

Resolves

Needed for google/blockly#8064

Proposed Changes

Updates the keyboard-navigation plugin to use the API provided by getContents

Reason for Changes

Made a change to the type returned by getContents. This hasn't been released yet other than in betas so this isn't a breaking change.

Test Coverage

Tested by linking blockly & blockly-samples together to test both PRs and verified you can navigate buttons and blocks.

Documentation

Additional Information

@maribethb maribethb requested a review from a team as a code owner May 8, 2024 18:43
@maribethb maribethb requested review from BeksOmega and removed request for a team May 8, 2024 18:43
@maribethb
Copy link
Contributor Author

The tests fail because navigation doesn't work with the current beta (7) because getContents returns something different there. They pass locally when the corresponding change to blockly is included. Will need to hold submitting this until we release another beta (likely Friday) but can be reviewed now.

if (firstFlyoutItem instanceof Blockly.FlyoutButton) {
const astNode = Blockly.ASTNode.createButtonNode(firstFlyoutItem);
if (!firstFlyoutItem) return;
if (firstFlyoutItem.type === 'button' && firstFlyoutItem.button) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the type guaranteed to be lowercase? would it be possible to just check the property instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

core uses an enum so yes it will be lowercase. the enum isn't exported so i can't use it here. it's probably fine to just check the property... we don't actually use the type property anywhere afaik. i don't know why we have it. will update

Copy link
Contributor

Choose a reason for hiding this comment

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

Sweet feel free to merge after update! or if you decide to not change it. Lemme know if you'd prefer re-review.

@maribethb maribethb merged commit 4d429c0 into google:rc/v11.0.0 May 13, 2024
7 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.

2 participants