mui-x icon indicating copy to clipboard operation
mui-x copied to clipboard

[pickers] Add key on shortcut items

Open noraleonte opened this issue 1 year ago • 1 comments

closes https://github.com/mui/mui-x/issues/12968

noraleonte avatar May 02 '24 16:05 noraleonte

Deploy preview: https://deploy-preview-12976--material-ui-x.netlify.app/

Generated by :no_entry_sign: dangerJS against b89a0b3fde3e8675baf876030d4f9926fe07f36d

mui-bot avatar May 02 '24 16:05 mui-bot

Sorry, a rushed request for changes. Will leave full feedback soon. 😉 Short version: it doesn't work and creates react errors

Why is that? I tried it last time and just now again and it did not throw any errors for me.

michelengelen avatar May 03 '24 09:05 michelengelen

Why is that? I tried it last time and just now again and it did not throw any errors for me.

It doesn't do anything, because the key on Listitem is still left as is. The error is thrown on CodeSandbox, locally I didn't see it as well. 🙈 Screenshot 2024-05-03 at 12 53 29

LukasTy avatar May 03 '24 09:05 LukasTy

@LukasTy What you are proposing is great, I think the main pain point here was that users couldn't give unique identifiers. id should solve that 👌

Like, even if it's not currently typed, users could pass color: 'primary' and make such shortcut chip seem selected.

Slightly unrelated, but circling back to this, we could maybe type it 🤷‍♀️ Technically, a shortcut item should accept all the props that a chip does

noraleonte avatar May 03 '24 10:05 noraleonte