From 3f22ed039120b39563d2566e0442f45867312151 Mon Sep 17 00:00:00 2001 From: Andrew Jakubowicz Date: Thu, 22 Jun 2023 15:35:38 -0700 Subject: [PATCH] fix(menu)!: rename typeaheadBufferDelay and list-tab-index for consistency BREAKING_CHANGE: Renamed property `typeaheadBufferDelay` to `typeaheadDelay`, and attribute `list-tab-index` to `list-tabindex`. PiperOrigin-RevId: 542685976 --- menu/demo/demo.ts | 2 +- menu/demo/stories.ts | 8 ++++---- menu/lib/menu.ts | 6 +++--- select/lib/select.ts | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/menu/demo/demo.ts b/menu/demo/demo.ts index 87c6e044a0..c6ed34b0da 100644 --- a/menu/demo/demo.ts +++ b/menu/demo/demo.ts @@ -85,7 +85,7 @@ const collection = defaultValue: 0, ui: numberInput(), }), - new Knob('typeaheadBufferTime', { + new Knob('typeaheadDelay', { defaultValue: 200, ui: numberInput(), }), diff --git a/menu/demo/stories.ts b/menu/demo/stories.ts index e0aab611d0..2a1e0a3de4 100644 --- a/menu/demo/stories.ts +++ b/menu/demo/stories.ts @@ -34,7 +34,7 @@ export interface StoryKnobs { skipRestoreFocus: boolean; xOffset: number; yOffset: number; - typeaheadBufferTime: number; + typeaheadDelay: number; listTabIndex: number; ariaLabel: string; @@ -227,7 +227,7 @@ const menuWithoutButton: MaterialStoryInit = { .fixed=${knobs.fixed} .defaultFocus=${knobs.defaultFocus!} .skipRestoreFocus=${knobs.skipRestoreFocus} - .typeaheadBufferTime=${knobs.typeaheadBufferTime} + .typeaheadDelay=${knobs.typeaheadDelay} .stayOpenOnOutsideClick=${knobs.stayOpenOnOutsideClick} .stayOpenOnFocusout=${knobs.stayOpenOnFocusout} @close-menu=${displayCloseEvent(fourthOutputRef)}> @@ -303,7 +303,7 @@ function renderSubMenu( .yOffset=${knobs.yOffset} .fixed=${knobs.fixed} .defaultFocus=${knobs.defaultFocus!} - .typeaheadBufferTime=${knobs.typeaheadBufferTime}> + .typeaheadDelay=${knobs.typeaheadDelay}> ${content} ${renderLinkableItems(['Link'], knobs)} `; @@ -329,7 +329,7 @@ function renderMenu( .fixed=${knobs.fixed} .defaultFocus=${knobs.defaultFocus!} .skipRestoreFocus=${knobs.skipRestoreFocus} - .typeaheadBufferTime=${knobs.typeaheadBufferTime} + .typeaheadDelay=${knobs.typeaheadDelay} .stayOpenOnOutsideClick=${knobs.stayOpenOnOutsideClick} .stayOpenOnFocusout=${knobs.stayOpenOnFocusout} @close-menu=${onClose}> diff --git a/menu/lib/menu.ts b/menu/lib/menu.ts index e0690a9689..45149ff164 100644 --- a/menu/lib/menu.ts +++ b/menu/lib/menu.ts @@ -122,7 +122,7 @@ export abstract class Menu extends LitElement { /** * The tabindex of the underlying list element. */ - @property({type: Number, attribute: 'list-tab-index'}) listTabIndex = 0; + @property({type: Number, attribute: 'list-tabindex'}) listTabIndex = 0; /** * The role of the underlying list element. */ @@ -132,7 +132,7 @@ export abstract class Menu extends LitElement { * it clears the typeahead buffer. */ @property({type: Number, attribute: 'typeahead-delay'}) - typeaheadBufferTime = DEFAULT_TYPEAHEAD_BUFFER_TIME; + typeaheadDelay = DEFAULT_TYPEAHEAD_BUFFER_TIME; /** * The corner of the anchor which to align the menu in the standard logical * property style of _. @@ -195,7 +195,7 @@ export abstract class Menu extends LitElement { typeaheadController = new TypeaheadController(() => { return { getItems: () => this.items, - typeaheadBufferTime: this.typeaheadBufferTime, + typeaheadBufferTime: this.typeaheadDelay, active: this.typeaheadActive }; }); diff --git a/select/lib/select.ts b/select/lib/select.ts index 67c11ff78f..36c207db4a 100644 --- a/select/lib/select.ts +++ b/select/lib/select.ts @@ -286,7 +286,7 @@ export abstract class Select extends LitElement { .open=${this.open} .quick=${this.quick} .fixed=${this.menuFixed} - .typeaheadBufferTime=${this.typeaheadDelay} + .typeaheadDelay=${this.typeaheadDelay} @opening=${this.handleOpening} @closing=${this.handleClosing} @close-menu=${this.handleCloseMenu}