mirror of
https://github.com/SerenityOS/serenity
synced 2026-05-05 06:32:26 +02:00
LibWeb: Add support for navigating text <input> with End key
This commit is contained in:
committed by
Andreas Kling
parent
939c10b201
commit
8a168b2bc0
@@ -515,6 +515,11 @@ bool EventHandler::handle_keydown(KeyCode key, unsigned modifiers, u32 code_poin
|
||||
m_browsing_context.set_cursor_position(DOM::Position { node, 0 });
|
||||
return true;
|
||||
}
|
||||
if (key == KeyCode::Key_End) {
|
||||
auto& node = *static_cast<DOM::Text*>(const_cast<DOM::Node*>(m_browsing_context.cursor_position().node()));
|
||||
m_browsing_context.set_cursor_position(DOM::Position { node, (unsigned)node.data().length() });
|
||||
return true;
|
||||
}
|
||||
if (!should_ignore_keydown_event(code_point)) {
|
||||
m_edit_event_handler->handle_insert(m_browsing_context.cursor_position(), code_point);
|
||||
m_browsing_context.increment_cursor_position_offset();
|
||||
|
||||
Reference in New Issue
Block a user