LibWeb: Don't attempt to set selection if control has no selectable text

This commit is contained in:
Tim Ledbetter
2024-09-08 23:59:31 +01:00
committed by Jelle Raaijmakers
parent 8d6f36f8d6
commit 2c8fb49578
4 changed files with 18 additions and 0 deletions

View File

@@ -463,6 +463,9 @@ void HTMLTextAreaElement::queue_firing_input_event()
void HTMLTextAreaElement::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())