-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
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
[Table] Add React node support to TablePagination.labelRowsPerPage #21226
[Table] Add React node support to TablePagination.labelRowsPerPage #21226
Conversation
Details of bundle changes.Comparing: d49be19...c091588 Details of page changes
|
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.
Something like getByRole('listbox').toHaveAccessibleName('some label made of nodes')
should do.
@eps1lon I couldn't make it work with the proposed solution. I have used testing-playground.com to find an alternative. |
@@ -94,9 +96,13 @@ describe('<TablePagination />', () => { | |||
</TableFooter> | |||
</table>, | |||
); | |||
|
|||
expect(getByRole('button', { name: 'Zeilen pro Seite:' })).to.have.text('10'); |
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.
The new test
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.
That test looks odd. Let me take a look before merging
|
@@ -123,6 +124,7 @@ const TablePagination = React.forwardRef(function TablePagination(props, ref) { | |||
input={<InputBase className={clsx(classes.input, classes.selectRoot)} />} | |||
value={rowsPerPage} | |||
onChange={onChangeRowsPerPage} | |||
id={selectId} |
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.
If an id is required, should it be generated internally by the Select component? Meaning moving the useId from the TablePagination to here:
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.
Also removing the filter of #20356 as no longer useful?
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.
I'd like to handle this in a separate PR.
@eps1lon Thanks for polishing it, much better! @AlexAndriyanenko thanks for looking into it :) |
Closes #20488