mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-10 13:00:29 +03:00
LibWeb: Refresh text-<input> contents when pressing backspace or delete
Make sure to refresh the contents of text-<input> when pressing backspace or delete key. The methods 'handle_insert()' and 'handle_delete()' already had the call to 'm_browsing_context.active_document()->force_layout()' so let us also add it to 'handle_delete_character_after()'.
This commit is contained in:
parent
e2d797dd60
commit
4877e7593c
Notes:
sideshowbarker
2024-07-17 18:33:33 +09:00
Author: https://github.com/kennethmyhra Commit: https://github.com/SerenityOS/serenity/commit/4877e7593c Pull-request: https://github.com/SerenityOS/serenity/pull/12647
@ -33,6 +33,11 @@ void EditEventHandler::handle_delete_character_after(const DOM::Position& cursor
|
||||
builder.append(text.substring_view(cursor_position.offset() + code_point_length));
|
||||
node.set_data(builder.to_string());
|
||||
|
||||
// FIXME: When nodes are removed from the DOM, the associated layout nodes become stale and still
|
||||
// remain in the layout tree. This has to be fixed, this just causes everything to be recomputed
|
||||
// which really hurts performance.
|
||||
m_browsing_context.active_document()->force_layout();
|
||||
|
||||
m_browsing_context.did_edit({});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user