mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 06:37:43 +00:00
LibWeb: Add support for navigating text <input> with Home key
This commit is contained in:
parent
f18ae27fe9
commit
939c10b201
1 changed files with 5 additions and 0 deletions
|
@ -510,6 +510,11 @@ bool EventHandler::handle_keydown(KeyCode key, unsigned modifiers, u32 code_poin
|
|||
}
|
||||
return true;
|
||||
}
|
||||
if (key == KeyCode::Key_Home) {
|
||||
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, 0 });
|
||||
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