[Editor] Enable the thickness input when no editors are selected (bug 1881219)

This commit is contained in:
Calixte Denizet 2024-02-29 19:45:49 +01:00
parent c409121251
commit 7af90bb8bc
2 changed files with 74 additions and 0 deletions

View file

@ -1298,6 +1298,17 @@ class AnnotationEditorUIManager {
source: this,
details: Object.assign(this.#previousStates, details),
});
// We could listen on our own event but it sounds like a bit weird and
// it's a way to simpler to handle that stuff here instead of having to
// add something in every place where an editor can be unselected.
if (
this.#mode === AnnotationEditorType.HIGHLIGHT &&
details.hasSelectedEditor === false
) {
this.#dispatchUpdateUI([
[AnnotationEditorParamsType.HIGHLIGHT_FREE, true],
]);
}
}
}