LibWeb: Fix select dropdown position when scrolled on a page

This commit is contained in:
Bastiaan van der Plaat 2023-12-20 18:17:32 +01:00 committed by Andreas Kling
parent 44ff957784
commit 29ee576345
2 changed files with 2 additions and 2 deletions

View file

@ -234,7 +234,7 @@ Tab::Tab(BrowserWindow* window, WebContentOptions const& web_content_options, St
view().on_request_select_dropdown = [this](Gfx::IntPoint content_position, i32 minimum_width, Vector<Web::HTML::SelectItem> items) {
m_select_dropdown->clear();
m_select_dropdown->setMinimumWidth(minimum_width);
m_select_dropdown->setMinimumWidth(minimum_width / view().device_pixel_ratio());
for (auto const& item : items) {
select_dropdown_add_item(m_select_dropdown, item);
}

View file

@ -366,7 +366,7 @@ void WebContentClient::did_request_color_picker(Color const& current_color)
void WebContentClient::did_request_select_dropdown(Gfx::IntPoint content_position, i32 minimum_width, Vector<Web::HTML::SelectItem> const& items)
{
if (m_view.on_request_select_dropdown)
m_view.on_request_select_dropdown(m_view.to_widget_position(content_position), m_view.to_widget_position(Gfx::IntPoint { minimum_width, 0 }).x(), items);
m_view.on_request_select_dropdown(content_position, minimum_width, items);
}
void WebContentClient::did_finish_handling_input_event(bool event_was_accepted)