mirror of
https://github.com/codex-team/editor.js
synced 2026-03-15 23:25:47 +01:00
Fix: hide Inlie Toolbar when user strart typing
This commit is contained in:
parent
38d1abfee0
commit
3b7596501b
3 changed files with 11 additions and 6 deletions
8
dist/editor.js
vendored
8
dist/editor.js
vendored
File diff suppressed because one or more lines are too long
|
|
@ -113,7 +113,7 @@ export default class BlockEvents extends Module {
|
|||
ConversionToolbar.tryToShow(block);
|
||||
} else {
|
||||
ConversionToolbar.close();
|
||||
InlineToolbar.tryToShow();
|
||||
InlineToolbar.tryToShow(true);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue