-
Notifications
You must be signed in to change notification settings - Fork 85
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: hide overlay if position target element is hidden #7454
Conversation
If the target element is hidden, either by having `display: none` set to itself of any of its parents, a resize observer for that element is triggered. This change adds a check for the target element size on the resize observer callback and closes the overlay in case the element is hidden. Fixes #7437
|
@@ -232,6 +232,11 @@ export const PositionMixin = (superClass) => | |||
|
|||
const targetRect = this.positionTarget.getBoundingClientRect(); | |||
|
|||
if (targetRect.width === 0 && targetRect.height === 0 && this.opened) { |
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.
Note: this condition can be potentially refactored to use !this.positionTarget.checkVisibility() && this.opened
, but checkVisibility
is only supported in Safari 17.4+.
* fix: hide overlay if position target element is hidden If the target element is hidden, either by having `display: none` set to itself of any of its parents, a resize observer for that element is triggered. This change adds a check for the target element size on the resize observer callback and closes the overlay in case the element is hidden. Fixes #7437
* fix: hide overlay if position target element is hidden If the target element is hidden, either by having `display: none` set to itself of any of its parents, a resize observer for that element is triggered. This change adds a check for the target element size on the resize observer callback and closes the overlay in case the element is hidden. Fixes #7437
* fix: hide overlay if position target element is hidden If the target element is hidden, either by having `display: none` set to itself of any of its parents, a resize observer for that element is triggered. This change adds a check for the target element size on the resize observer callback and closes the overlay in case the element is hidden. Fixes #7437
…4.3) (#7457) * fix: hide overlay if position target element is hidden If the target element is hidden, either by having `display: none` set to itself of any of its parents, a resize observer for that element is triggered. This change adds a check for the target element size on the resize observer callback and closes the overlay in case the element is hidden. Fixes #7437 Co-authored-by: Diego Cardoso <[email protected]>
…4.4) (#7456) * fix: hide overlay if position target element is hidden If the target element is hidden, either by having `display: none` set to itself of any of its parents, a resize observer for that element is triggered. This change adds a check for the target element size on the resize observer callback and closes the overlay in case the element is hidden. Fixes #7437 Co-authored-by: Diego Cardoso <[email protected]>
…3.5) (#7455) * fix: hide overlay if position target element is hidden (#7454) * fix: hide overlay if position target element is hidden If the target element is hidden, either by having `display: none` set to itself of any of its parents, a resize observer for that element is triggered. This change adds a check for the target element size on the resize observer callback and closes the overlay in case the element is hidden. Fixes #7437 * chore: add missing nextRender import * test: import text-field in combo-box-light mock test --------- Co-authored-by: Diego Cardoso <[email protected]>
This ticket/PR has been released with Vaadin 24.5.0.alpha1 and is also targeting the upcoming stable 24.5.0 version. |
Description
If the target element is hidden, either by having
display: none
set to itself or any of its parents, a resize observer for that element is triggered.This change adds a check for the target element size on the resize observer callback and closes the overlay in case the element is hidden.
Fixes #7437
Type of change