-
Notifications
You must be signed in to change notification settings - Fork 273
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-dialog): fix text selection on chrome #3532
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Text selection is still not possible in the following samples:
"resizable dialog"
"draggable & resizable dialog"
"empty dialog (no focusable element)"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The build for this PR is fixed, but there is a failing test for the Popover, which is caused by this change
WICG/webcomponents#773 On Chrome, clicking on slotted elements (light DOM) in the dialog (shadow DOM) causes the focus to travel up the light DOM tree to reach the closes element that is focusable. Which ends to be the body element as document.activeElement. This is not the case for FF & Safari, where the focus travels up the slot, reaching the dialog root which is actually the closest focusable element. This change introduces a workaround to align the focus behaviour in Chrome with the other browsers. Fixes #3466
d7e4327
to
b68bfdf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- add a unit test
- fix is not working for sample "Open empty dialog (no focusable element)" on Dialog.html test page
I couldn't find a way to select text with wdio to test this. Fixed the case for the sample "Open empty dialog (no focusable element)" |
adressed comments
Is the following expected? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's wait for the last comment to be resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lint error
15:1 error @ui5/webcomponents-base/dist/Device.js
import should occur before import of ./generated/templates/PopupTemplate.lit.js
import/order
On Chrome, clicking on slotted elements (light DOM) in the dialog (shadow DOM) causes the focus to travel up the light DOM tree to reach the closes element that is focusable. Which ends to be the body element as document.activeElement. This is not the case for FF & Safari, where the focus travels up the slot, reaching the dialog root which is actually the closest focusable element. This change introduces a workaround to align the focus behaviour in Chrome with the other browsers. Related issue: WICG/webcomponents#773 Fixes #3466
On Chrome, clicking on slotted elements (light DOM) in the
dialog (shadow DOM) causes the focus to travel up the light DOM tree to
reach the closes element that is focusable.
Which ends to be the body element as document.activeElement.
This is not the case for FF & Safari, where the focus travels up the
slot, reaching the dialog root which is actually the closest focusable element.
This change introduces a workaround to align the focus behaviour in Chrome
with the other browsers.
Related issue: WICG/webcomponents#773
Fixes #3466