diff options
author | teapotd <teapot404@gmail.com> | 2020-01-10 19:02:41 +0100 |
---|---|---|
committer | teapotd <teapot404@gmail.com> | 2020-01-10 19:02:41 +0100 |
commit | c7a31990a253d4c47608cdc6130236010efdb919 (patch) | |
tree | d87f1d72271fc8f851ac815ab94575be5d45e38d /components/script/textinput.rs | |
parent | c6192dc286ce0496b76998c900b48cdf7cdabdfe (diff) | |
download | servo-c7a31990a253d4c47608cdc6130236010efdb919.tar.gz servo-c7a31990a253d4c47608cdc6130236010efdb919.zip |
Allow deletion from overflowed textinput
Diffstat (limited to 'components/script/textinput.rs')
-rw-r--r-- | components/script/textinput.rs | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/components/script/textinput.rs b/components/script/textinput.rs index 0401134bd66..bc4c1c4a6cb 100644 --- a/components/script/textinput.rs +++ b/components/script/textinput.rs @@ -450,12 +450,6 @@ impl<T: ClipboardProvider> TextInput<T> { let allowed_to_insert_count = if let Some(max_length) = self.max_length { let len_after_selection_replaced = self.utf16_len().saturating_sub(self.selection_utf16_len()); - if len_after_selection_replaced >= max_length { - // If, after deleting the selection, the len is still greater than the max - // length, then don't delete/insert anything - return; - } - max_length.saturating_sub(len_after_selection_replaced) } else { UTF16CodeUnits(usize::MAX) |