Closed rick-gnous closed 1 year ago
That's awesome. Just that you know, there's no need to "do it all". And if you think the API needs some more stabilization, we can always mark this as experimental like the tree
(with a feature flag).
I have a strange bug : when I change the month with buttons or by selecting a new date, the Select's initial_selection
isn't updated. Else, I think it's good for this part, I'll start to add Date Selector.
I think it'll be better if we add it as experimental, yes. I would like to avoid Select as it's deprecated but I don't take the time to check the others alternatives.
Yea, the Select
component is something to replace for PF5.
Most likely the initial_selection
is updated. However, as it's the "initial" selection, the component will not update it's internal state based on that.
I think Select
needs to be re-implemented based on hooks and a more exterior state management (e.g. using use_state_eq
).
I don't want to promise anything, but maybe I can take a look at this at the end of the week.
One more thing I noticed (and I can also swap this out later). I know we had the pattern of Callback::from
a lot. However, use_callback
makes more sense, as it keeps a stable instance, and reduces changes/redraws.
I've changed some Callback::from
with use_callback
. I'm working on DatePicker
now.
Thank you for yours explanations ! If you can't take a look, I'll try to check it next week.
If you can't take a look, I'll try to check it next week.
I don't want to promise anything. Whoever gets there first :wink:
@rick-gnous I just played with it. This is great!
I went ahead and created a new SimpleSelect
component, based on the new, more modular, menu framework. I think this should be what you need. It's pushed to main
and there is an example in the quickstart project.
Maybe I find some time this week to migrate your calendar to it.
awesome, thank you ! I'll change my calendar for it. I'll also continue DatePicker !
Btw, it would be great if you could also push a (draft or not) PR for the quickstart … I had to "invent" one myself. Which also is fine. But if you already did the work, I wouldn't want to waste your effort.
And I think we're good ! (btw https://github.com/patternfly-yew/patternfly-yew-quickstart/pull/32)
I'm trying to implement CalendarMonth. I must implement more things, like range, fix bugs and I would like to implement DatePicker with it. Actually, you can use it with a callback to get the new date and a default date.
I prefer to open this pull request early to get reviews and avoid mistakes. I'll try to continue the development next week if I've time.
I've also written a basic example for patternfly-yew-quickstart.