mirror of
https://github.com/SerenityOS/serenity
synced 2026-05-03 21:02:39 +02:00
LibWeb: Don't attempt to set selection if control has no selectable text
(cherry picked from commit 2c8fb4957871bca5694fc9e9f8932c9769967bd1)
This commit is contained in:
committed by
Nico Weber
parent
a7d5ea0264
commit
a77b65d46a
@@ -2387,6 +2387,9 @@ HTMLInputElement::ValueAttributeMode HTMLInputElement::value_attribute_mode() co
|
||||
|
||||
void HTMLInputElement::selection_was_changed(size_t selection_start, size_t selection_end)
|
||||
{
|
||||
if (!m_text_node)
|
||||
return;
|
||||
|
||||
document().set_cursor_position(DOM::Position::create(realm(), *m_text_node, selection_end));
|
||||
|
||||
if (auto selection = document().get_selection())
|
||||
|
||||
Reference in New Issue
Block a user