Skip to content

Commit a2b3204

Browse files
Elliott Marquezcopybara-github
authored andcommitted
fix(select): select menu render is over most stacking contexts with popover
Fixes #4812 This feature defaults to using the popover API for the underlying menu in select. If not available (FF and older versions of Safari and Chrome), defaults to using fixed. PiperOrigin-RevId: 580666310
1 parent 8dcb3f6 commit a2b3204

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

select/demo/demo.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,10 @@ const collection = new MaterialCollection<KnobTypesToKnobs<StoryKnobs>>(
3636
new Knob('errorText', {ui: textInput(), defaultValue: ''}),
3737
new Knob('supportingText', {ui: textInput(), defaultValue: ''}),
3838
new Knob('menuPositioning', {
39-
defaultValue: 'absolute' as const,
40-
ui: selectDropdown<'absolute' | 'fixed'>({
39+
defaultValue: 'popover' as const,
40+
ui: selectDropdown<'absolute' | 'fixed' | 'popover'>({
4141
options: [
42+
{label: 'popover', value: 'popover'},
4243
{label: 'absolute', value: 'absolute'},
4344
{label: 'fixed', value: 'fixed'},
4445
],

select/demo/stories.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export interface StoryKnobs {
2323
errorText: string;
2424
supportingText: string;
2525
error: boolean;
26-
menuPositioning: 'absolute' | 'fixed' | undefined;
26+
menuPositioning: 'absolute' | 'fixed' | 'popover' | undefined;
2727

2828
'md-select Slots': void;
2929
'slot=leading-icon': string;

select/internal/select.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ export abstract class Select extends selectBaseClass {
107107
* element with stacking context and hidden overflows such as `md-dialog`.
108108
*/
109109
@property({attribute: 'menu-positioning'})
110-
menuPositioning: 'absolute' | 'fixed' = 'absolute';
110+
menuPositioning: 'absolute' | 'fixed' | 'popover' = 'popover';
111111

112112
/**
113113
* The max time between the keystrokes of the typeahead select / menu behavior

0 commit comments

Comments
 (0)