Fix: hide Inlie Toolbar when user strart typing

This commit is contained in:
Peter Savchenko 2019-07-01 13:30:34 +03:00
commit 3b7596501b
No known key found for this signature in database
GPG key ID: E68306B1AB0F727C
3 changed files with 11 additions and 6 deletions

8
dist/editor.js vendored

File diff suppressed because one or more lines are too long

View file

@ -113,7 +113,7 @@ export default class BlockEvents extends Module {
ConversionToolbar.tryToShow(block);
} else {
ConversionToolbar.close();
InlineToolbar.tryToShow();
InlineToolbar.tryToShow(true);
}
/**

View file

@ -150,9 +150,14 @@ export default class InlineToolbar extends Module {
/**
* Shows Inline Toolbar if something is selected
* @param {boolean} [needToClose] - pass true to close toolbar if it is not allowed.
* Avoid to use it just for closing IT, better call .close() clearly.
*/
public tryToShow(): void {
public tryToShow(needToClose: boolean = false): void {
if (!this.allowedToShow()) {
if (needToClose) {
this.close();
}
return;
}