[#584] open timezone selector dropdown on button click (#593)

This commit is contained in:
Camille Moussu
2026-03-03 10:23:29 +01:00
committed by GitHub
parent 3bd43c9935
commit 4591a31599
2 changed files with 15 additions and 5 deletions
@@ -14,7 +14,7 @@ interface TimezoneAutocompleteProps {
zones: string[];
getTimezoneOffset: (tzName: string) => string;
showIcon?: boolean;
autoFocus?: boolean;
inputRef?: React.Ref<HTMLInputElement>;
width?: number | string;
size?: "small" | "medium";
placeholder?: string;
@@ -23,6 +23,7 @@ interface TimezoneAutocompleteProps {
onClose?: () => void;
disableClearable?: boolean;
hideBorder?: boolean;
openOnFocus?: boolean;
}
export function TimezoneAutocomplete({
@@ -31,7 +32,7 @@ export function TimezoneAutocomplete({
zones,
getTimezoneOffset,
showIcon = false,
autoFocus = false,
inputRef,
width,
size = "small",
placeholder = "Select timezone",
@@ -40,6 +41,7 @@ export function TimezoneAutocomplete({
onClose,
disableClearable = false,
hideBorder = false,
openOnFocus = false,
}: TimezoneAutocompleteProps) {
const options = useMemo<TimezoneOption[]>(() => {
return zones.map((tz) => ({
@@ -53,7 +55,7 @@ export function TimezoneAutocomplete({
return (
<Autocomplete
autoFocus={autoFocus}
openOnFocus={openOnFocus}
value={selectedOption}
onChange={(event, newValue) => {
if (newValue) {
@@ -72,6 +74,7 @@ export function TimezoneAutocomplete({
placeholder={placeholder}
variant="outlined"
autoComplete="off"
inputRef={inputRef}
sx={
hideBorder
? {