mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Don't fire select event when selection hasn't changed
This commit is contained in:
parent
648bfbeb02
commit
e34f7c58c9
3 changed files with 19 additions and 98 deletions
|
@ -242,6 +242,12 @@ impl<T: ClipboardProvider> TextInput<T> {
|
|||
self.selection_start_offset() .. self.selection_end_offset()
|
||||
}
|
||||
|
||||
/// A tuple containing the (start, end, direction) of the current selection. Can be used to
|
||||
/// compare whether selection state has changed.
|
||||
pub fn selection_state(&self) -> (TextPoint, TextPoint, SelectionDirection) {
|
||||
(self.selection_start(), self.selection_end(), self.selection_direction)
|
||||
}
|
||||
|
||||
// Check that the selection is valid.
|
||||
fn assert_ok_selection(&self) {
|
||||
if let Some(begin) = self.selection_origin {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue