aboutsummaryrefslogtreecommitdiffstats
path: root/components/script
diff options
context:
space:
mode:
Diffstat (limited to 'components/script')
-rw-r--r--components/script/textinput.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/components/script/textinput.rs b/components/script/textinput.rs
index 35b49ee57a4..40ad401a903 100644
--- a/components/script/textinput.rs
+++ b/components/script/textinput.rs
@@ -20,7 +20,7 @@ pub enum Selection {
NotSelected
}
-#[derive(JSTraceable, Copy, Clone, HeapSizeOf)]
+#[derive(JSTraceable, Copy, Clone, HeapSizeOf, PartialEq)]
pub struct TextPoint {
/// 0-based line number
pub line: usize,
@@ -123,7 +123,7 @@ impl<T: ClipboardProvider> TextInput<T> {
/// Remove a character at the current editing point
pub fn delete_char(&mut self, dir: Direction) {
- if self.selection_begin.is_none() {
+ if self.selection_begin.is_none() || self.selection_begin == Some(self.edit_point) {
self.adjust_horizontal_by_one(dir, Selection::Selected);
}
self.replace_selection(DOMString::new());