diff --git a/pages/dropdown-list-placement.test.page.tsx b/pages/dropdown-list-placement.test.page.tsx new file mode 100644 index 0000000000..eedccfe050 --- /dev/null +++ b/pages/dropdown-list-placement.test.page.tsx @@ -0,0 +1,70 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +import React, { useState } from 'react'; +import { range } from 'lodash'; + +import { Autosuggest, Multiselect, Select } from '~components'; + +import { SimplePage } from './app/templates'; + +const options = range(0, 100).map(index => ({ value: (index + 1).toString() })); + +export default function Page() { + const [showError, setShowError] = useState(true); + const [autosuggestValue, setAutosuggestValue] = useState(''); + + const statusType = showError ? ('error' as const) : ('finished' as const); + const errorText = showError ? 'Error' : undefined; + const onLoadItems = ({ detail }: { detail: { samePage: boolean } }) => { + if (detail.samePage) { + setShowError(false); + } + }; + const asyncProps = { statusType, errorText, onLoadItems }; + + return ( + +
+
+
+ setAutosuggestValue(event.detail.value)} + ariaLabel="autosuggest" + placeholder="autosuggest" + {...asyncProps} + /> +
+ +
+