LibWeb: Improve <select> dropdown position

This commit is contained in:
Psychpsyo 2025-01-14 03:28:28 +01:00 committed by Sam Atkins
parent 3e81d7ea2e
commit 5b9d18b462
Notes: github-actions[bot] 2025-01-14 07:35:48 +00:00

View file

@ -431,7 +431,7 @@ void HTMLSelectElement::show_the_picker_if_applicable()
// Request select dropdown
auto weak_element = make_weak_ptr<HTMLSelectElement>();
auto rect = get_bounding_client_rect();
auto position = document().navigable()->to_top_level_position(Web::CSSPixelPoint { rect->x(), rect->y() });
auto position = document().navigable()->to_top_level_position(Web::CSSPixelPoint { rect->x(), rect->y() + rect->height() });
document().page().did_request_select_dropdown(weak_element, position, CSSPixels(rect->width()), m_select_items);
set_is_open(true);
}