mirror of
https://github.com/discourse/discourse.git
synced 2025-02-09 21:04:48 +00:00
FIX: cancel post toolbar on click outside (#23546)
On `mousedown` if the click is outside a cooked element cancel the `mousedown`/`mouseup` sequence and only rely on the `selectionchange` event. This change ensures a click on avatar for example will work, even if user is doing a rather slow click (meaning: the mousedown has been hold for more than 100ms).
This commit is contained in:
parent
9ac5e09179
commit
a32fa3b947
@ -233,9 +233,14 @@ export default class PostTextSelection extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@bind
|
@bind
|
||||||
async mousedown() {
|
mousedown(event) {
|
||||||
this.isMousedown = true;
|
|
||||||
this.holdingMouseDown = false;
|
this.holdingMouseDown = false;
|
||||||
|
|
||||||
|
if (!event.target.closest(".cooked")) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.isMousedown = true;
|
||||||
this.holdingMouseDownHandler = discourseLater(() => {
|
this.holdingMouseDownHandler = discourseLater(() => {
|
||||||
this.holdingMouseDown = true;
|
this.holdingMouseDown = true;
|
||||||
}, 100);
|
}, 100);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user