mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-18 13:44:50 +00:00
LibWeb: Invalidate input element style on focus change
The style of input and textarea elements is now invalidated when focus is changed to a new element. This ensures any `:focus` selectors are applied correctly.
This commit is contained in:
committed by
Sam Atkins
parent
9448c957c1
commit
572324d47b
@@ -1098,16 +1098,21 @@ void HTMLInputElement::update_slider_thumb_element()
|
||||
|
||||
void HTMLInputElement::did_receive_focus()
|
||||
{
|
||||
auto navigable = document().navigable();
|
||||
if (!navigable)
|
||||
return;
|
||||
if (!m_text_node)
|
||||
return;
|
||||
m_text_node->invalidate_style();
|
||||
auto navigable = document().navigable();
|
||||
if (!navigable) {
|
||||
return;
|
||||
}
|
||||
navigable->set_cursor_position(DOM::Position::create(realm(), *m_text_node, 0));
|
||||
}
|
||||
|
||||
void HTMLInputElement::did_lose_focus()
|
||||
{
|
||||
if (m_text_node)
|
||||
m_text_node->invalidate_style();
|
||||
|
||||
commit_pending_changes();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user