-
Notifications
You must be signed in to change notification settings - Fork 161
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
Avoid trying to focus a detached element #6090
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.
Reviewable status: 1 unresolved discussion, 0 of 1 LGTMs obtained (waiting on @Legioth)
flow-server/src/main/java/com/vaadin/flow/component/Focusable.java, line 110 at r1 (raw file):
* Make sure to call the focus function only after the element is * attached, and after the initial rendering cycle, so webcomponents can
How does this now make certain that the element is attached before calling focus?
All new tests except detachAfterFocus_nothingScheduled were passing also before this fix.
e6069a8
to
9824bcd
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.
Reviewable status: 1 unresolved discussion, 0 of 1 LGTMs obtained (waiting on @caalador)
flow-server/src/main/java/com/vaadin/flow/component/Focusable.java, line 110 at r1 (raw file):
Previously, caalador wrote…
* Make sure to call the focus function only after the element is * attached, and after the initial rendering cycle, so webcomponents can
How does this now make certain that the element is attached before calling focus?
That's handled by setTimeout
in the JS snippet. I've clarified the comment.
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.
Reviewed 1 of 2 files at r1, 1 of 1 files at r2.
Reviewable status: complete! all discussions resolved, 1 of 1 LGTMs obtained
All new tests except detachAfterFocus_nothingScheduled were passing also before this fix. (cherry picked from commit 329b5f6)
All new tests except detachAfterFocus_nothingScheduled were passing also before this fix. (cherry picked from commit 329b5f6)
All new tests except detachAfterFocus_nothingScheduled were passing also
before this fix.
This change is