Don't show formatting menu if formatting flag is disabled

This commit is contained in:
Scott Nonnenberg 2023-05-11 10:02:36 -07:00 committed by GitHub
parent 9d1252ae19
commit 65be832569
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -135,6 +135,12 @@ export class FormattingMenu {
}
scheduleRemoval(): void {
// Nothing to do
if (!this.referenceElement) {
return;
}
// Already scheduled
if (this.fadingOutTimeout) {
return;
}
@ -157,7 +163,7 @@ export class FormattingMenu {
}
onEditorChange(): void {
if (!this.options.isMenuEnabled) {
if (!this.options.isMenuEnabled || !this.options.isEnabled) {
this.scheduleRemoval();
return;
}