ui icon indicating copy to clipboard operation
ui copied to clipboard

fix: `initialFocus` breaks date-picker on firefox and ios-chrome

Open kitsunekyo opened this issue 2 years ago • 6 comments

initialFocus leads to the popover not opening on firefox and ios chrome.

i couldnt find any difference in accessibility with this change.

closes https://github.com/shadcn-ui/ui/issues/910

kitsunekyo avatar Oct 19 '23 07:10 kitsunekyo

@kitsunekyo is attempting to deploy a commit to the shadcn-pro Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Oct 19 '23 07:10 vercel[bot]

@kitsunekyo Can you help me reproduce this? I just tested in Firefox but was not sure what I should be looking for. Thank you.

shadcn avatar Oct 19 '23 16:10 shadcn

okay, it took me a while to actually reproduce this. but the culprit seems to be serverActions.

https://github.com/kitsunekyo/dialog-repro

with serverActions enabled, the only way i can get the date-picker to work is to delete initialFocus

kitsunekyo avatar Oct 19 '23 21:10 kitsunekyo

This work for me , I used date-picker on Sheet and not work os ios.

wiwatsrt avatar Dec 28 '23 03:12 wiwatsrt

@shadcn this is still broken for me atm

kitsunekyo avatar Jan 02 '24 08:01 kitsunekyo

Tested on ios/macos safari and chrome, initialFocus will make popover not showing, but the demo on shadcn page does work fine. We are using next.js 14 and not turning on sever action, actually we use client and export mode. So not sure what is the root cause since there is no error in console. So far have to move this attribute, btw, not sure what this one is doing because this is nothing change with/without this.

bella-quinn avatar Jan 13 '24 10:01 bella-quinn