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(ui5-SegmentedButton): keyboard handling now compliant with the specification #3709

Merged
merged 2 commits into from
Aug 23, 2021

Conversation

Todor-ads
Copy link
Member

@Todor-ads Todor-ads commented Aug 22, 2021

Focus is moved on the first element of Segmented Button or last element via PageUp or PageDown keyboard key.
Related to: #3091

@Todor-ads Todor-ads requested a review from unazko August 22, 2021 12:35
}
}

_onPageUpOrDown(pageUpPressed) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This function doesn't make the code more readable or structured. Better execute the code on place.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

@@ -213,7 +218,25 @@ class SegmentedButton extends UI5Element {
this._selectItem(event);
} else if (isSpace(event)) {
event.preventDefault();
} else if (isPageUp(event)) {
event.preventDefault();
this._onPageUpOrDown(isPageUp(event));
Copy link
Member

Choose a reason for hiding this comment

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

if you are already in this "if" block I think isPageUp(event) in "this._onPageUpOrDown(isPageUp(event))" is always true as already checked "else if (isPageUp(event)"

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

Copy link
Contributor

@unazko unazko left a comment

Choose a reason for hiding this comment

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

The code now seems good to me.

@ilhan007 ilhan007 merged commit d34afc1 into SAP:master Aug 23, 2021
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.

3 participants