mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
feat(web): rework combobox and add clear button (#7317)
* feat(web): rework combobox * simplify statement and use transition-all
This commit is contained in:
parent
749b182f97
commit
46f85618db
3 changed files with 84 additions and 58 deletions
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
const initialOption = timezones.find((item) => item.value === 'UTC' + initialDate.toFormat('ZZ'));
|
||||
|
||||
let selectedOption = {
|
||||
let selectedOption = initialOption && {
|
||||
label: initialOption?.label || '',
|
||||
value: initialOption?.value || '',
|
||||
};
|
||||
|
|
@ -36,7 +36,7 @@
|
|||
let selectedDate = initialDate.toFormat("yyyy-MM-dd'T'HH:mm");
|
||||
|
||||
// Keep local time if not it's really confusing
|
||||
$: date = DateTime.fromISO(selectedDate).setZone(selectedOption.value, { keepLocalTime: true });
|
||||
$: date = DateTime.fromISO(selectedDate).setZone(selectedOption?.value, { keepLocalTime: true });
|
||||
|
||||
const dispatch = createEventDispatcher<{
|
||||
cancel: void;
|
||||
|
|
@ -82,7 +82,7 @@
|
|||
</div>
|
||||
<div class="flex flex-col w-full mt-2">
|
||||
<label for="timezone">Timezone</label>
|
||||
<Combobox bind:selectedOption options={timezones} placeholder="Search timezone..." />
|
||||
<Combobox bind:selectedOption id="timezone" options={timezones} placeholder="Search timezone..." />
|
||||
</div>
|
||||
</div>
|
||||
</ConfirmDialogue>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue