mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
Fixed clicking on existing snippets in dropdown having no effect
no issue - mousedown handler in the snippet input component was automatically closing when it was detecting a mousedown event outside of the element - the new dropdown select is rendered in a wormhole outside of the component's element so the whole component was being destroyed before the mouseup listener on an option was fired
This commit is contained in:
parent
e9f2bfa92b
commit
8309904fcc
1 changed files with 4 additions and 1 deletions
|
@ -185,7 +185,10 @@ export default class KoenigSnippetInputLabsComponent extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
_handleMousedown(event) {
|
_handleMousedown(event) {
|
||||||
if (this.element && !event.target.closest(this.element.id)) {
|
const isOutsideElement = this.element && !event.target.closest(this.element.id);
|
||||||
|
const isOutsideDropdown = !event.target.closest('.ember-basic-dropdown-content');
|
||||||
|
|
||||||
|
if (isOutsideElement && isOutsideDropdown) {
|
||||||
this.args.cancel();
|
this.args.cancel();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue