mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: do not check if inside cooked early (#24105)
We already do this check inside `selectionChanged` and this was preventing us to correctly set `isSelecting` to true. This was causing issues when starting your selection from outside cooked.
This commit is contained in:
@@ -223,6 +223,10 @@ export default class PostTextSelection extends Component {
|
||||
|
||||
@bind
|
||||
onSelectionChanged() {
|
||||
if (this.isSelecting) {
|
||||
return;
|
||||
}
|
||||
|
||||
const { isIOS, isWinphone, isAndroid } = this.capabilities;
|
||||
const wait = isIOS || isWinphone || isAndroid ? INPUT_DELAY : 25;
|
||||
this.selectionChangeHandler = discourseDebounce(
|
||||
@@ -233,25 +237,13 @@ export default class PostTextSelection extends Component {
|
||||
}
|
||||
|
||||
@bind
|
||||
mousedown(event) {
|
||||
this.validMouseDown = true;
|
||||
|
||||
if (!event.target.closest(".cooked")) {
|
||||
this.validMouseDown = false;
|
||||
return;
|
||||
}
|
||||
|
||||
mousedown() {
|
||||
this.isSelecting = true;
|
||||
}
|
||||
|
||||
@bind
|
||||
mouseup() {
|
||||
this.isSelecting = false;
|
||||
|
||||
if (!this.validMouseDown) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.onSelectionChanged();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user