mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-24 08:59:50 +00:00
LibWeb: Implement up/down arrow navigation in textarea
This commit is contained in:
parent
888cb038e8
commit
23aadc02ca
Notes:
github-actions[bot]
2025-08-15 10:33:20 +00:00
Author: https://github.com/mikiubo
Commit: 23aadc02ca
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4975
Reviewed-by: https://github.com/trflynn89 ✅
6 changed files with 111 additions and 0 deletions
|
|
@ -1321,6 +1321,16 @@ EventResult EventHandler::handle_keydown(UIEvents::KeyCode key, u32 modifiers, u
|
|||
return EventResult::Handled;
|
||||
}
|
||||
|
||||
if (key == UIEvents::KeyCode::Key_Up || key == UIEvents::KeyCode::Key_Down) {
|
||||
auto collapse = modifiers & UIEvents::Mod_Shift ? InputEventsTarget::CollapseSelection::No : InputEventsTarget::CollapseSelection::Yes;
|
||||
if (key == UIEvents::KeyCode::Key_Up) {
|
||||
target->decrement_cursor_position_to_previous_line(collapse);
|
||||
} else {
|
||||
target->increment_cursor_position_to_next_line(collapse);
|
||||
}
|
||||
return EventResult::Handled;
|
||||
}
|
||||
|
||||
if (key == UIEvents::KeyCode::Key_Home) {
|
||||
auto collapse = modifiers & UIEvents::Mod_Shift ? InputEventsTarget::CollapseSelection::No : InputEventsTarget::CollapseSelection::Yes;
|
||||
target->move_cursor_to_start(collapse);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue