mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 06:47:35 +00:00
LibWeb: Add support for navigating text <input> with End key
This commit is contained in:
parent
939c10b201
commit
8a168b2bc0
1 changed files with 5 additions and 0 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue