all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [yew-devel] [PATCH yew-widget-toolkit] widget: dropdown: update picker placement after showing
@ 2024-12-20  9:26 Dominik Csapak
  0 siblings, 0 replies; only message in thread
From: Dominik Csapak @ 2024-12-20  9:26 UTC (permalink / raw)
  To: yew-devel

It seems that under certain circumstances (e.g. a dropdown in a dialog)
updating the position of the picker before it's openend (it's a
popover) does not work properly in safari/webkit/epiphany.

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 | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/src/widget/dropdown.rs b/src/widget/dropdown.rs
index f9b49f1..62f3597 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,13 @@ 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());
+            }
+        }
+
         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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-12-20  9:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-12-20  9:26 [yew-devel] [PATCH yew-widget-toolkit] widget: dropdown: update picker placement after showing Dominik Csapak

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal