@@ -5,13 +5,13 @@ import {
55 AutocompleteSetters ,
66 AutocompleteStore ,
77 AutocompleteRefresh ,
8- GetDropdownProps ,
8+ GetPanelProps ,
99 GetEnvironmentProps ,
1010 GetFormProps ,
1111 GetInputProps ,
1212 GetItemProps ,
1313 GetLabelProps ,
14- GetMenuProps ,
14+ GetListProps ,
1515 GetRootProps ,
1616} from './types' ;
1717import { getSelectedItem , isOrContainsNode } from './utils' ;
@@ -36,7 +36,7 @@ export function getPropGetters<TItem, TEvent, TMouseEvent, TKeyboardEvent>({
3636 const getEnvironmentProps : GetEnvironmentProps = ( getterProps ) => {
3737 return {
3838 // On touch devices, we do not rely on the native `blur` event of the
39- // input to close the dropdown , but rather on a custom `touchstart` event
39+ // input to close the panel , but rather on a custom `touchstart` event
4040 // outside of the autocomplete elements.
4141 // This ensures a working experience on mobile because we blur the input
4242 // on touch devices when the user starts scrolling (`touchmove`).
@@ -50,7 +50,7 @@ export function getPropGetters<TItem, TEvent, TMouseEvent, TKeyboardEvent>({
5050
5151 const isTargetWithinAutocomplete = [
5252 getterProps . searchBoxElement ,
53- getterProps . dropdownElement ,
53+ getterProps . panelElement ,
5454 ] . some ( ( contextNode ) => {
5555 return (
5656 contextNode &&
@@ -69,7 +69,7 @@ export function getPropGetters<TItem, TEvent, TMouseEvent, TKeyboardEvent>({
6969 // When scrolling on touch devices (mobiles, tablets, etc.), we want to
7070 // mimic the native platform behavior where the input is blurred to
7171 // hide the virtual keyboard. This gives more vertical space to
72- // discover all the suggestions showing up in the dropdown .
72+ // discover all the suggestions showing up in the panel .
7373 onTouchMove ( event : TouchEvent ) {
7474 if (
7575 store . getState ( ) . isOpen === false ||
@@ -90,7 +90,7 @@ export function getPropGetters<TItem, TEvent, TMouseEvent, TKeyboardEvent>({
9090 role : 'combobox' ,
9191 'aria-expanded' : store . getState ( ) . isOpen ,
9292 'aria-haspopup' : 'listbox' ,
93- 'aria-owns' : store . getState ( ) . isOpen ? `${ props . id } -menu ` : undefined ,
93+ 'aria-owns' : store . getState ( ) . isOpen ? `${ props . id } -list ` : undefined ,
9494 'aria-labelledby' : `${ props . id } -label` ,
9595 ...rest ,
9696 } ;
@@ -156,7 +156,7 @@ export function getPropGetters<TItem, TEvent, TMouseEvent, TKeyboardEvent>({
156156 ) => {
157157 function onFocus ( event : TEvent ) {
158158 // We want to trigger a query when `openOnFocus` is true
159- // because the dropdown should open with the current query.
159+ // because the panel should open with the current query.
160160 if ( props . openOnFocus || store . getState ( ) . query . length > 0 ) {
161161 onInput ( {
162162 query : store . getState ( ) . completion || store . getState ( ) . query ,
@@ -185,7 +185,7 @@ export function getPropGetters<TItem, TEvent, TMouseEvent, TKeyboardEvent>({
185185 store . getState ( ) . isOpen && store . getState ( ) . selectedItemId !== null
186186 ? `${ props . id } -item-${ store . getState ( ) . selectedItemId } `
187187 : undefined ,
188- 'aria-controls' : store . getState ( ) . isOpen ? `${ props . id } -menu ` : undefined ,
188+ 'aria-controls' : store . getState ( ) . isOpen ? `${ props . id } -list ` : undefined ,
189189 'aria-labelledby' : `${ props . id } -label` ,
190190 value : store . getState ( ) . completion || store . getState ( ) . query ,
191191 id : `${ props . id } -input` ,
@@ -236,13 +236,13 @@ export function getPropGetters<TItem, TEvent, TMouseEvent, TKeyboardEvent>({
236236 }
237237 } ,
238238 onClick : ( event ) => {
239- // When the dropdown is closed and you click on the input while
239+ // When the panel is closed and you click on the input while
240240 // the input is focused, the `onFocus` event is not triggered
241241 // (default browser behavior).
242- // In an autocomplete context, it makes sense to open the menu in this
242+ // In an autocomplete context, it makes sense to open the panel in this
243243 // case.
244244 // We mimic this event by catching the `onClick` event which
245- // triggers the `onFocus` for the dropdown to open.
245+ // triggers the `onFocus` for the panel to open.
246246 if (
247247 providedProps . inputElement ===
248248 props . environment . document . activeElement &&
@@ -263,21 +263,21 @@ export function getPropGetters<TItem, TEvent, TMouseEvent, TKeyboardEvent>({
263263 } ;
264264 } ;
265265
266- const getMenuProps : GetMenuProps = ( rest ) => {
266+ const getListProps : GetListProps = ( rest ) => {
267267 return {
268268 role : 'listbox' ,
269269 'aria-labelledby' : `${ props . id } -label` ,
270- id : `${ props . id } -menu ` ,
270+ id : `${ props . id } -list ` ,
271271 ...rest ,
272272 } ;
273273 } ;
274274
275- const getDropdownProps : GetDropdownProps < TMouseEvent > = ( rest ) => {
275+ const getPanelProps : GetPanelProps < TMouseEvent > = ( rest ) => {
276276 return {
277277 onMouseDown ( event ) {
278- // Prevents the `activeElement` from being changed to the dropdown so
278+ // Prevents the `activeElement` from being changed to the panel so
279279 // that the blur event is not triggered, otherwise it closes the
280- // dropdown .
280+ // panel .
281281 ( ( event as unknown ) as MouseEvent ) . preventDefault ( ) ;
282282 } ,
283283 onMouseLeave ( ) {
@@ -391,8 +391,8 @@ export function getPropGetters<TItem, TEvent, TMouseEvent, TKeyboardEvent>({
391391 getFormProps,
392392 getLabelProps,
393393 getInputProps,
394- getDropdownProps ,
395- getMenuProps ,
394+ getPanelProps ,
395+ getListProps ,
396396 getItemProps,
397397 } ;
398398}
0 commit comments