From d.csapak at proxmox.com Fri Dec 20 10:26:39 2024 From: d.csapak at proxmox.com (Dominik Csapak) Date: Fri, 20 Dec 2024 10:26:39 +0100 Subject: [yew-devel] [PATCH yew-widget-toolkit] widget: dropdown: update picker placement after showing Message-ID: <20241220092639.718362-1-d.csapak@proxmox.com> 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 --- 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 From d.csapak at proxmox.com Fri Dec 20 11:31:39 2024 From: d.csapak at proxmox.com (Dominik Csapak) Date: Fri, 20 Dec 2024 11:31:39 +0100 Subject: [yew-devel] [PATCH yew-widget-toolkit v2] widget: dropdown: update picker placement after showing Message-ID: <20241220103139.1186480-1-d.csapak@proxmox.com> 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 --- 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 From d.csapak at proxmox.com Fri Dec 20 11:42:56 2024 From: d.csapak at proxmox.com (Dominik Csapak) Date: Fri, 20 Dec 2024 11:42:56 +0100 Subject: [yew-devel] [PATCH yew-widget-toolkit v2] widget: dropdown: update picker placement after showing In-Reply-To: <20241220103139.1186480-1-d.csapak@proxmox.com> References: <20241220103139.1186480-1-d.csapak@proxmox.com> Message-ID: <947c7d55-0bc5-4ac9-bd0d-6ddce37a8794@proxmox.com> argh sry, forgot to add the changelog (a trivial one, but still), so here it is: changes from v1: * changed commit message to include more details * add comment to moved code block to make the intent of the position clear From m.sandoval at proxmox.com Fri Dec 20 11:45:21 2024 From: m.sandoval at proxmox.com (Maximiliano Sandoval) Date: Fri, 20 Dec 2024 11:45:21 +0100 Subject: [yew-devel] [PATCH yew-widget-toolkit v2] widget: dropdown: update picker placement after showing In-Reply-To: <947c7d55-0bc5-4ac9-bd0d-6ddce37a8794@proxmox.com> References: <20241220103139.1186480-1-d.csapak@proxmox.com> <947c7d55-0bc5-4ac9-bd0d-6ddce37a8794@proxmox.com> Message-ID: This patch fixes the Theme selector dropdown not being visible in Epiphany 47.2. Tested-by: Maximiliano Sandoval Dominik Csapak writes: > argh sry, forgot to add the changelog (a trivial one, but still), so here it is: > > changes from v1: > * changed commit message to include more details > * add comment to moved code block to make the intent of the position clear > > > _______________________________________________ > yew-devel mailing list > yew-devel at lists.proxmox.com > https://lists.proxmox.com/cgi-bin/mailman/listinfo/yew-devel From t.lamprecht at proxmox.com Fri Dec 20 16:03:57 2024 From: t.lamprecht at proxmox.com (Thomas Lamprecht) Date: Fri, 20 Dec 2024 16:03:57 +0100 Subject: [yew-devel] applied: [PATCH yew-widget-toolkit v2] widget: dropdown: update picker placement after showing In-Reply-To: <20241220103139.1186480-1-d.csapak@proxmox.com> References: <20241220103139.1186480-1-d.csapak@proxmox.com> Message-ID: <06b7abe9-83e6-45f1-8915-e49adc1dd765@proxmox.com> On 20/12/2024 11:31, Dominik Csapak wrote: > 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 > --- > src/widget/dropdown.rs | 14 ++++++++------ > 1 file changed, 8 insertions(+), 6 deletions(-) > > applied, with Maximiliano's T-b and also the comment slightly extend for why this is done, thanks!