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

fix(platform): icon-tab-bar _generateTabBarItems function improvement #12581

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dpavlenishvili
Copy link
Contributor

Related Issue(s)

closes #12474 #12554

Description

Screenshots

Before:

After:

Please check whether the PR fulfills the following requirements

During Implementation
  1. Visual Testing:
  • visual misalignments/updates
  • check Light/Dark/HCB/HCW themes
  • RTL/LTR - proper rendering and labeling
  • responsiveness(resize)
  • Content Density (Cozy/Compact/(Condensed))
  • States - hover/disabled/focused/active/on click/selected/selected hover/press state
  • Interaction/Animation - open/close, expand/collapse, add/remove, check/uncheck
  • Mouse vs. Keyboard support
  • Text Truncation
  1. API and functional correctness
  • check for console logs (warnings, errors)
  • API boundary values
  • different combinations of components - free style
  • change the API values during testing
  1. Documentation and Example validations
  • missing API documentation or it is not understandable
  • poor examples
  • Stackblitz works for all examples
  1. Accessibility testing
  2. Browser Testing - Edge, Safari, Chrome, Firefox
PR Quality

@dpavlenishvili dpavlenishvili added the bug Something isn't working label Oct 17, 2024
@dpavlenishvili dpavlenishvili requested a review from a team October 17, 2024 12:29
@dpavlenishvili dpavlenishvili self-assigned this Oct 17, 2024
@dpavlenishvili dpavlenishvili linked an issue Oct 17, 2024 that may be closed by this pull request
Copy link

netlify bot commented Oct 17, 2024

Deploy Preview for fundamental-ngx ready!

Name Link
🔨 Latest commit 9682b20
🔍 Latest deploy log https://app.netlify.com/sites/fundamental-ngx/deploys/67110337d053c900085a43b9
😎 Deploy Preview https://deploy-preview-12581--fundamental-ngx.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

Visit the preview URL for this PR (updated for commit 9682b20):

https://fundamental-ngx-gh--pr12581-12474-icon-tab-bar-o-mz63j9a8.web.app

(expires Sun, 20 Oct 2024 12:34:00 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 41b993ee8e451bd7c6770b342ce142dc886eacff

if (!('color' in item)) {
item.color = 'default';
}
item.color = item.color || 'default';
Copy link
Contributor

Choose a reason for hiding this comment

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

What if you store item.color || 'default' in a variable instead of modifying the value directly?
For example: const color = item.color || 'default'
You can then use this variable in cssClasses.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Mutating item.color directly ensures that the item consistently has a valid color property in all cases inside return. By updating item.color early, it prevents potential future issues when item.color is referenced elsewhere in the result object or other parts of the code. Essentially, it is necessary for item.color to always have a valid value, but there is no better way to set it by default without similar mutation.

Copy link
Contributor

@khotcholava khotcholava left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Icon Tab Bar overflow bug
2 participants