-
Notifications
You must be signed in to change notification settings - Fork 353
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(Dropdown): updated deprecated usage to new dropdown #8868
Conversation
Preview: https://patternfly-react-pr-8868.surge.sh A11y report: https://patternfly-react-pr-8868-a11y.surge.sh |
dbe91f7
to
8d52e9e
Compare
@mceledonia @mmenestr @andrew-ronaldson would like to get your opinion on this one. See the question posed by @thatblindgeye in the description above. The gist of this is that by deprecating the old dropdown, we loose the badge variant that allows us to make a badge into a toggle. We could add that to Menu Toggle, but there's a question how useful this is. This was a feaure that was requested for condensing a long breadcrumb control. Not aware that it's used anyplace else. Here are two links where you can compare the existing vs. new implementation: Existing: https://www.patternfly.org/v4/components/breadcrumb#with-dropdown Updated: https://patternfly-react-pr-8868.surge.sh/components/breadcrumb#with-dropdown Note the changed positioning of the caret. I'm OK with the updated implementation but also wanted to get your opinion. Don't recall where this is being used, but if you are aware, I can also check with that team as they may need to do some rework to update to PatternFly 5. |
@mcarrano Nicole pointed me towards a demo that has a badge toggle using MenuToggle similar to the old Dropdown BadgeToggle: composable dropdown variants So I can actually implement that in this update, unless another approach is agreed on. From what I have seen so far, two areas where we're using a badge toggle like this in examples is the Breadcrumb example and the Menu Drilldown with breadcrumb example. |
Sounds good @thatblindgeye |
3ae37c5
to
6512eaf
Compare
6512eaf
to
58852cf
Compare
You should be able to remove the wrapping div if you pass For the TreeView action menu, I thought the keyboard handler should prevent propagation up to the outer handler (so if the focus is in the Dropdown that handler should run and not the TreeView) but maybe that needs some tweaking. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@thatblindgeye Glad you were able to work out the issue with the badge style dropdown. But I am seeing a spacing difference between this and the current implementation:
Can that be fixed?
@mcarrano There's a couple of ways we could go about that I think:
Here's what option 1 looks like with just a single space: Here's what option 2 looks like (8px left padding on |
@thatblindgeye Took some time this morning to review other places affected by this change. Here are additional problems I found... In all full page demos, the user menu is not rendering correctly. See below. Should look like this: I'm not entirely comfortable with effect of this on the Date & Time picker as it now feels like the time widget is no longer a part of the control. I wonder if we'd be better off adding back the border even if it means it means we need to keep the caret. @mmenestr @andrew-ronaldson what do you think? |
@mcarrano I should be able to resolve the user menu issue based on Katie's comment above. Will wait for Andrew and/or Margot's input on the timepicker (can also make updates to the badge toggle depending what you think of my latest comment above) |
@thatblindgeye regarding fixes to the badge dropdown, I'd be OK with either approach. Although option 2 is perhaps a more robust way to do this? Maybe see what others think. |
@mcarrano @thatblindgeye I agree it's a bit weird that the calendar icon isn't floating, but the time picker icon is. I would expect them both to be treated the same. I don't think having a dropdown styling with caret is much better, but I feel its probably a bit better than no border at all. This is making me wonder why we created a combined date and time picker, without also creating a combined time + calendar menu to go with it... I feel like in cases where date pickers and time pickers are both needed, it would be better to use the original components side by side rather than this hybrid version which seems a bit odd. But that's a whole other issue. |
b902979
to
450b8ca
Compare
@mcarrano Made some updates to help resolve the spacing issue on the badge toggle as well as the dropdown used in full page demos for the username (should now be full height as it was before). @mmenestr For the Timepicker, I removed the variant so that it matches the second screenshot Matt shared for now. Should we open a followup issue to resolve how we ultimately want that timepicker toggle to look? |
I took at look at your changes @thatblindgeye . The breadcrumb update looks good. For the Date & Time picker, can we fix this so that the clock icon does not get cut off? @mmenestr agree about the Date & Time demo. Would you mind opening an issue to reconsider that? It's definitely beyond the scope of this PR. |
@mcarrano For the timepicker icon, it looks like it's being cut off in Firefox due to the Moving that div element to only wrap the text input works, or I can pass the clock icon to the If the spacing isn't too bad I'll push that change, since it may make more sense to pass only an icon to the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one looks good with the follow up issues.
7ec49d6
to
f0fd7ce
Compare
As first step for moving to the new PF5/Dropdown component. See patternfly/patternfly-react#8835 and patternfly/patternfly-react#8868 Changes made by https://github.com/patternfly/pf-codemods
As first step for moving to the new PF5/Dropdown component. See patternfly/patternfly-react#8835 and patternfly/patternfly-react#8868 Changes made by https://github.com/patternfly/pf-codemods
What: Closes #8839
Pages from the surge that were updated (some with notes, other notes after this list):
Other notes:
div
that is rendered around Dropdown's Popper prevents MenuToggle from being full height whenisFullHeight
is passed (we may not need that wrapper anymore since moving forward we're defaulting to an "inline" appendTo, which that wrapper div was just to give the Popper something to append to)Original comment regarding badge toggle
Wanted to put a draft up to get some opinion on the Menu Toggle with badge implementation (seen in the Breadcrumb with dropdown example here).
With the deprecated Dropdown, there was a separate BadgeToggle sub-component that was used, but MenuToggle doesn't have that. What I did for now in this PR is just pass Badge component as a child to MenuToggle (rather than using the
badge
prop), and set it to aplainText
variant. I figured right now that would be the simplest way to show how a consumer could use this new composable implementation.Alternatively we could maybe implement a new prop in MenuToggle that would create a "BadgeToggle", but one possible issue is whether that would get confusing since we already have an
icon
andbadge
prop on MenuToggle. Some ideas:There may need some Core followup as I did notice the breadcrumb items with a dropdown weren't centered right. Changing the
.pf-c-breadcrumb__item
"align-items" property tocenter
instead ofbaseline
may help, but I haven't looked into whether that would cause any other issues.Additional issues: