mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 09:45:06 +02:00
LibWeb/HTML: Correctly reset selection on type change
The selection now gets reset to the beginning of the control if the type changes from an unselectable type to a selectable type.
This commit is contained in:
committed by
Tim Ledbetter
parent
84e29f791c
commit
5f75558646
Notes:
github-actions[bot]
2025-04-23 06:21:13 +00:00
Author: https://github.com/skyz1 Commit: https://github.com/LadybirdBrowser/ladybird/commit/5f755586461 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4410 Reviewed-by: https://github.com/tcl3 ✅
@@ -1470,6 +1470,7 @@ void HTMLInputElement::type_attribute_changed(TypeAttributeState old_state, Type
|
||||
// 9. If previouslySelectable is false and nowSelectable is true, set the element's text entry cursor position to the
|
||||
// beginning of the text control, and set its selection direction to "none".
|
||||
if (!previously_selectable && now_selectable) {
|
||||
set_the_selection_range(0, 0);
|
||||
set_selection_direction(OptionalNone {});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user