Skip to content
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

[core] feat(Tabs): allow panel prop to be a renderer #6621

Merged

Conversation

bvandercar-vt
Copy link
Contributor

@bvandercar-vt bvandercar-vt commented Jan 3, 2024

feat(Tabs): allow panel prop to be a renderer, pass tabTitleId and tabPanelId to the renderer.

Reason: a developer may want to use these IDs for accessibility, such as aria-controls.

Checklist

  • Includes tests
  • Update documentation

@bvandercar-vt bvandercar-vt changed the title export generateTabPanelId, generateTabTitleId feat(Tabs): allow panel prop to be a renderer, pass tabTitleId and tabPanelId Jan 3, 2024
Copy link
Contributor

@adidahiya adidahiya left a comment

Choose a reason for hiding this comment

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

seems like a reasonable change. thanks for adding a unit test. just one question about the test...

id="first"
panel={({ tabTitleId, tabPanelId }) => {
assert.equal(tabTitleId, generateTabTitleId(ID, "first"));
assert.equal(tabPanelId, generateTabPanelId(ID, "first"));
Copy link
Contributor

Choose a reason for hiding this comment

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

are you sure these assertions are getting run in this test? I think you need to use the Mocha async done syntax.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I was a little confused on how to write this test, was curious how you would do it.

are you sure these assertions are getting run in this test?

Yep, it does work. If I change the expected value, I see a failure.

@adidahiya adidahiya changed the title feat(Tabs): allow panel prop to be a renderer, pass tabTitleId and tabPanelId [core] feat(Tabs): allow panel prop to be a renderer Feb 9, 2024
@adidahiya adidahiya enabled auto-merge (squash) February 9, 2024 14:49
@adidahiya adidahiya merged commit c9941b7 into palantir:develop Feb 9, 2024
12 checks passed
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.

2 participants