Skip to content

Conversation

@thatblindgeye
Copy link
Contributor

@thatblindgeye thatblindgeye commented Apr 7, 2022

What: Closes #7123

Currently this update changes the outer element of the toggle from a div to a button, and placing class names where appropriate. I also added in the aria-haspopup prop to match the current Core workspace.

This can also be updated to be more of an opt-in where a prop can be passed in to decide whether the entire toggle text should be clickable (button) or whether it should behave as it currently does in React where only the icon is clickable (div).

Pagination preview build for convenience.

Additional issues:

@patternfly-build
Copy link
Collaborator

patternfly-build commented Apr 7, 2022

Copy link
Member

@mcarrano mcarrano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great. Thanks @thatblindgeye !

Copy link
Contributor

@nicolethoen nicolethoen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tlabaj just checking whether you think changing the OptionsMenu with a Dropdown in the Pagination constitutes a breaking change? Since our tests had to be updated, I wonder if products' tests might end up in a similar situation?

@thatblindgeye thatblindgeye marked this pull request as ready for review April 12, 2022 15:38
Copy link
Contributor

@kmcfaul kmcfaul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the tests reference an id it may not be breaking but if it uses a selector routing through the options menu then the tests may break. I don't know if tests having an issue constitutes a breaking change though.

@tlabaj
Copy link
Contributor

tlabaj commented Apr 13, 2022

Yes, this would constitute a breaking change. Products may also be using the selector to apply custom styling.

1 similar comment
@tlabaj
Copy link
Contributor

tlabaj commented Apr 13, 2022

Yes, this would constitute a breaking change. Products may also be using the selector to apply custom styling.

<>
{showToggle && (
<React.Fragment>
<span className={css(styles.optionsMenuToggleText)}>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Products could be applying custom styles here . This would be a breaking change.

Copy link
Contributor

@mcoker mcoker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Tho I think we should change the component prop on <Pagination> to be something that refers to the menu.

Also assuming we continue to bundle this menu with the pagination component, and we keep the options menu over using a menu-toggle/menu pair, should we make a note in a breaking change release to just use the <OptionsMenu> component? It looks like we're reconstructing parts of it in this component. I could be reading it wrong though.

/** The type or title of the items being paginated */
itemsTitle?: string;
/** The text to be displayed on the Options Toggle */
/** Accessible label for the Options Toggle */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just spot checked a handful of other react component props and we use the "accessible label" wording to describe the function of a [whatever]AriaLabel prop. This may be OK, just wanted to mention it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a fair point. My main reason for changing the description was due to "text to be displayed" didn't seem accurate either, as it seemed like the prop was only being used to add an aria-label to that dropdown toggle.

Copy link
Contributor

@mcoker mcoker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 🥳

Copy link
Contributor

@tlabaj tlabaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tlabaj tlabaj merged commit b3c0c6f into patternfly:main Apr 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Pagination] - update the items per page toggle so text is clickable

7 participants