-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Fix breadcrumb rendering issue when overflow item is at last index #4787
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 breadcrumb rendering issue when overflow item is at last index #4787
Conversation
|
resetting the build to see if something hiccup'd with screener. |
| <li className={ this._classNames.listItem } key={ item.key || String(index) }> | ||
| { onRenderItem(item, this._onRenderItem) } | ||
| { index !== lastItemIndex && ( | ||
| { (index !== lastItemIndex || (hasOverflowItems && index === overflowIndex! - 1)) && ( |
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.
mind adding some parenthesis to ensure your booleans are evaluating what to expect?
&& index === (overflowIndex - 1)
Also you shouldn't need to add a ! after overflowIndex; should it default to a value? Or should you check for undefined?
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.
We have the overflowIndex as default props but the default props is not working with optional props. Compiler complains Object is possibly 'undefined'
* master: (52 commits) Marqueeselection style update (microsoft#4803) Applying package updates. FocusZone: Add the ability to stop focus from propagating outside the FocusZone (microsoft#4823) Unknown persona coin (microsoft#4809) Applying package updates. BaseButton: Allow Alt + Down on menu buttons to open the menu (microsoft#4807) Applying package updates. Website: Scroll to top of page on navigation (microsoft#4810) Applying package updates. ActivityItem: fix getstyles (microsoft#4802) Mark Slider#ValuePosition enum as deprecated as it is unused. (microsoft#4799) Icon: ensure `styles` still works. (microsoft#4805) Popup: Added check for onBlur to prevent focus setting focus to be incorrectly disabled when closing a menu in Chrome (microsoft#4804) Update package.json Move <Layer> to use React portals when available (microsoft#4724) Fix breadcrumb rendering issue when overflow item is at last index (microsoft#4787) Fixes focus issue for contextual menus (microsoft#4744) Remove redundant selected items prop on BaseExtendedPicker (microsoft#4769) SearchBox: New prop for turning off icon animation (microsoft#4794) Add functions to ContextualMenuItem to open and close menus on command (microsoft#4741) ...
Pull request checklist
$ npm run changeDescription of changes
The Breadcrumb component renders the divider to the last item when overflow index is set to the last item. Also the divider is not rendered next to the normal item for the case A > ...
In the first scenario, we don't check last index when rendering overflow item
In second scenario, we need to allow to render divider if there is a overflow item.
This change checks for those values and renders it correctly
to
@dzearing Could you take a look