From: Dominik Csapak <d.csapak@proxmox.com>
To: yew-devel@lists.proxmox.com
Subject: [yew-devel] [PATCH yew-widget-toolkit v2] widget: dropdown: update picker placement after showing
Date: Fri, 20 Dec 2024 11:31:39 +0100 [thread overview]
Message-ID: <20241220103139.1186480-1-d.csapak@proxmox.com> (raw)
It seems that under certain circumstances (e.g. a dropdown in a dialog)
updating the position of the picker before it's opened (it's a
popover) does not work properly in safari/webkit/epiphany.
When trying to open such a dropdown, it (or some parts of it) would
be rendered with a height of 0px, even though the elements have
a height set explicitly.
To fix this, update the picker placement after opening it. What exactly
is the cause (e.g. if it's a browser bug or our css/aligning) is yet to
be determined.
This fixes an issue on webkit (tested with epiphany) that opening
dropdowns in a dialog did not show the dropdown properly.
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
src/widget/dropdown.rs | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/src/widget/dropdown.rs b/src/widget/dropdown.rs
index f9b49f1..a125bf6 100644
--- a/src/widget/dropdown.rs
+++ b/src/widget/dropdown.rs
@@ -510,12 +510,6 @@ impl Component for PwtDropdown {
}
}
- if let Some(placer) = &self.picker_placer {
- if let Err(err) = placer.update() {
- log::error!("error updating placement: {}", err.to_string());
- }
- }
-
if self.show != self.last_show {
self.last_show = self.show;
if let Some(popover_node) = self.picker_ref.get() {
@@ -533,6 +527,14 @@ impl Component for PwtDropdown {
}
}
}
+
+ // update picker placement after we opened/closed it
+ if let Some(placer) = &self.picker_placer {
+ if let Err(err) = placer.update() {
+ log::error!("error updating placement: {}", err.to_string());
+ }
+ }
+
self.focus_on_field = false;
}
}
--
2.39.5
_______________________________________________
yew-devel mailing list
yew-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/yew-devel
next reply other threads:[~2024-12-20 10:32 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-20 10:31 Dominik Csapak [this message]
2024-12-20 10:42 ` Dominik Csapak
2024-12-20 10:45 ` Maximiliano Sandoval
2024-12-20 15:03 ` [yew-devel] applied: " Thomas Lamprecht
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241220103139.1186480-1-d.csapak@proxmox.com \
--to=d.csapak@proxmox.com \
--cc=yew-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox