-
Notifications
You must be signed in to change notification settings - Fork 0
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
fix: ensure selected tab from overflow is correctly displayed #19
Conversation
WalkthroughThe update enhances the tab navigation logic in the Changes
Assessment against linked issues
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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.
Actionable comments posted: 1
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- src/main/resources/META-INF/frontend/fcEnhancedTabs/connector.js (1 hunks)
Additional context used
Biome
src/main/resources/META-INF/frontend/fcEnhancedTabs/connector.js
[error] 66-66: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
Additional comments not posted (1)
src/main/resources/META-INF/frontend/fcEnhancedTabs/connector.js (1)
68-71
: Review the logic within thewhile
loop.The
while
loop dynamically adjusts the position of the tabs based on their visibility. The logic appears correct, but ensure that__detectOverflow
does not have side effects that could lead to unexpected behavior when called multiple times within the loop.Do you want to ensure that calling
__detectOverflow
multiple times within the loop does not lead to unintended side effects?
src/main/resources/META-INF/frontend/fcEnhancedTabs/connector.js
Outdated
Show resolved
Hide resolved
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.
Actionable comments posted: 0
Outside diff range and nitpick comments (2)
src/main/resources/META-INF/frontend/fcEnhancedTabs/connector.js (2)
67-67
: Consider usinglet
instead ofvar
foroverflowIndex
.Using
let
instead ofvar
can help avoid potential issues with variable scoping and accidental redeclarations.- let overflowIndex = buttons.findIndex(e=>e.style.visibility); + let overflowIndex = buttons.findIndex(e=>e.style.visibility);
66-66
: Consider using optional chaining.Using optional chaining can make the code more concise and handle cases where
e.style
might be undefined.- const selectedIndex = buttons.findIndex(e=>e.item.component && e.item.component.querySelector('vaadin-tab[selected]')); + const selectedIndex = buttons.findIndex(e=>e.item?.component?.querySelector('vaadin-tab[selected]'));Tools
Biome
[error] 66-66: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- src/main/resources/META-INF/frontend/fcEnhancedTabs/connector.js (1 hunks)
Additional context used
Biome
src/main/resources/META-INF/frontend/fcEnhancedTabs/connector.js
[error] 66-66: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
Close #16
Summary by CodeRabbit