focus promoted/owned attributes input after activating the ribbon tab, closes #2606

This commit is contained in:
zadam
2022-02-01 20:24:58 +01:00
parent be44431fde
commit 46eaa63625
6 changed files with 31 additions and 11 deletions

View File

@@ -497,6 +497,16 @@ export default class AttributeEditorWidget extends NoteContextAwareWidget {
await this.renderOwnedAttributes(attributes, false);
}
focus() {
this.$editor.trigger('focus');
this.textEditor.model.change( writer => {
const positionAt = writer.createPositionAt(this.textEditor.model.document.getRoot(), 'end');
writer.setSelection(positionAt);
} );
}
entitiesReloadedEvent({loadResults}) {
if (loadResults.getAttributes(this.componentId).find(attr => attributeService.isAffecting(attr, this.note))) {
this.refresh();