[tabs] Modernize implementation#751
Merged
mj12albert merged 20 commits intomui:masterfrom Nov 25, 2024
Merged
Conversation
Netlify deploy preview |
4dbf848 to
16c8fbb
Compare
16c8fbb to
683f8a9
Compare
c31706a to
5a7f24f
Compare
This comment was marked as outdated.
This comment was marked as outdated.
5a7f24f to
46d11b3
Compare
mj12albert
commented
Nov 15, 2024
| } | ||
|
|
||
| if (nextIndex !== activeIndex && !isIndexOutOfBounds(elementsRef, nextIndex)) { | ||
| event.stopPropagation(); |
Member
Author
There was a problem hiding this comment.
@atomiks Why is stopPropagation() needed here, and is it ever ok to force propagate it? This breaks a test
Given this structure:
<Tabs.Root onKeyDown={handleKeyDown}>
<Tabs.List>
<Tabs.Tab value={0} />
<Tabs.Tab value={1} />
</Tabs.List>
{/* tab panels */}
</Tabs.Root>Tabs.List is a CompositeRoot, so on arrow keys, the event doesn't propagate and handleKeyDown doesn't get called
Contributor
There was a problem hiding this comment.
I'm not certain on that. It may not be necessary in most cases
Member
Author
There was a problem hiding this comment.
OK ~ let's let it propagate by default, but I've put a param around it just in case:
if (stopEventPropagation) {
event.stopPropagation();
}
46d11b3 to
17e3dcc
Compare
17e3dcc to
bc1840f
Compare
useCompound with Composite55e7dd5 to
353f95a
Compare
353f95a to
7bd5663
Compare
a2a0bfe to
f00fd3d
Compare
f00fd3d to
430bfb9
Compare
26bba8c to
65b1053
Compare
65b1053 to
ab269fd
Compare
michaldudak
approved these changes
Nov 25, 2024
1 task
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A custom metadata object can be passed into
Compositecomponents and hooksReplace
useCompoundwithCompositeRenamenot yet, need to discuss the overall approach further [internal] Use adirectionprop todirDirectionProviderto configure text direction (RTL/LTR) #831I have followed (at least) the PR section of the contributing guide.