diff --git a/Libraries/LibWeb/HTML/FormAssociatedElement.cpp b/Libraries/LibWeb/HTML/FormAssociatedElement.cpp index a01eb99dd4..568dd09277 100644 --- a/Libraries/LibWeb/HTML/FormAssociatedElement.cpp +++ b/Libraries/LibWeb/HTML/FormAssociatedElement.cpp @@ -794,7 +794,7 @@ void FormAssociatedTextControlElement::decrement_cursor_position_to_previous_wor while (true) { if (auto offset = text_node->word_segmenter().previous_boundary(m_selection_end); offset.has_value()) { - auto word = text_node->data().code_points().substring_view(m_selection_end, m_selection_end - *offset); + auto word = text_node->data().code_points().substring_view(*offset, m_selection_end - *offset); if (collapse == CollapseSelection::Yes) { collapse_selection_to_offset(*offset); } else {