Skip to content

Commit

Permalink
fix(menu)!: rename typeaheadBufferDelay and list-tab-index for consis…
Browse files Browse the repository at this point in the history
…tency

BREAKING_CHANGE: Renamed property `typeaheadBufferDelay` to `typeaheadDelay`, and attribute `list-tab-index` to `list-tabindex`.
PiperOrigin-RevId: 542685976
  • Loading branch information
AndrewJakubowicz authored and copybara-github committed Jun 22, 2023
1 parent 4ec6d4e commit 3f22ed0
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion menu/demo/demo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const collection =
defaultValue: 0,
ui: numberInput(),
}),
new Knob('typeaheadBufferTime', {
new Knob('typeaheadDelay', {
defaultValue: 200,
ui: numberInput(),
}),
Expand Down
8 changes: 4 additions & 4 deletions menu/demo/stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export interface StoryKnobs {
skipRestoreFocus: boolean;
xOffset: number;
yOffset: number;
typeaheadBufferTime: number;
typeaheadDelay: number;
listTabIndex: number;
ariaLabel: string;

Expand Down Expand Up @@ -227,7 +227,7 @@ const menuWithoutButton: MaterialStoryInit<StoryKnobs> = {
.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)}>
Expand Down Expand Up @@ -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)}
</md-menu>`;
Expand All @@ -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}>
Expand Down
6 changes: 3 additions & 3 deletions menu/lib/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand All @@ -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 <block>_<inline>.
Expand Down Expand Up @@ -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
};
});
Expand Down
2 changes: 1 addition & 1 deletion select/lib/select.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down

0 comments on commit 3f22ed0

Please sign in to comment.