From 12012c10296bc7bfdb08a8411e767ff0adc0e340 Mon Sep 17 00:00:00 2001 From: Tanya Fomina Date: Mon, 1 Aug 2022 21:46:36 +0300 Subject: [PATCH] Comments --- .../modules/toolbar/blockSettings.ts | 2 +- src/components/utils/popover.ts | 18 ++++++++++++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/components/modules/toolbar/blockSettings.ts b/src/components/modules/toolbar/blockSettings.ts index a2d4a68c..01001981 100644 --- a/src/components/modules/toolbar/blockSettings.ts +++ b/src/components/modules/toolbar/blockSettings.ts @@ -176,8 +176,8 @@ export default class BlockSettings extends Module { */ private makeToolTunesButtonsNavigatable(): void { const { StylesAPI } = this.Editor; + /** Query buttons and inputs inside tunes html */ const toolSettings = this.nodes.renderedTunes?.querySelectorAll( - // Select buttons and inputs `.${StylesAPI.classes.settingsButton}, ${$.allInputsSelector}` ); diff --git a/src/components/utils/popover.ts b/src/components/utils/popover.ts index f9361c89..45b37016 100644 --- a/src/components/utils/popover.ts +++ b/src/components/utils/popover.ts @@ -577,16 +577,26 @@ export default class Popover extends EventsDispatcher { } /** - * Returns list of items available for keyboard navigation. + * Returns list of elements available for keyboard navigation. * Contains both usual popover items elements and custom html content. */ private get flippableElements(): HTMLElement[] { - const popoverItems = Array.from(this.nodes.wrapper.querySelectorAll(`.${Popover.CSS.item}`)) as HTMLElement[]; - const customItems = this.customContent ? Array.from(this.customContent.querySelectorAll( + /** + * Select html elements of popover items + */ + const popoverItemsElements = Array.from(this.nodes.wrapper.querySelectorAll(`.${Popover.CSS.item}`)) as HTMLElement[]; + + /** + * Select html elements inside custom content that are marked with special css class to be available for keyboard navigation + */ + const customContentElements = this.customContent ? Array.from(this.customContent.querySelectorAll( `.${Popover.CSS.itemFlippable}` )) as HTMLElement[] : []; - return customItems.concat(popoverItems); + /** + * Combine both lists and return + */ + return customContentElements.concat(popoverItemsElements); } /**