Skip to content

Commit

Permalink
fix: MenuItemWrapper should not pass-through 'on' prop (#21170)
Browse files Browse the repository at this point in the history
* fix: MenuItemWrapper should not pass-through 'on' prop

* Update packages/fluentui/CHANGELOG.md
  • Loading branch information
tosmolka authored Jan 11, 2022
1 parent 4835e91 commit d5c1802
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/fluentui/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
- Fix `ChatMessage` to use chat context as default value when user prop is explicitly undefined @yuanboxue-amber ([#21189](https://github.com/microsoft/fluentui/pull/21189))
- bump react-transition-group from 4.3.0 to 4.4.1 @yuanboxue-amber ([#21187](https://github.com/microsoft/fluentui/pull/21187))
- Fix `Animation` to pass object ref to `Transition` nodeRef @yuanboxue-amber ([#21173](https://github.com/microsoft/fluentui/pull/21173))
- Fix `MenuItemWrapper` to stop passing-through `on` property to DOM @tosmolka ([#21170](https://github.com/microsoft/fluentui/pull/21170))


<!--------------------------------[ v0.60.0 ]------------------------------- -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ MenuItemWrapper.propTypes = {
secondary: customPropTypes.every([customPropTypes.disallow(['primary']), PropTypes.bool]),
underlined: PropTypes.bool,
vertical: PropTypes.bool,
on: PropTypes.oneOf(['hover']),
};

MenuItemWrapper.handledProps = Object.keys(MenuItemWrapper.propTypes) as any;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ describe('Menu', () => {
items[1].on = 'hover';
const menu = mountWithProvider(<Menu items={items} />);

expect(menu.find('li').at(1).getDOMNode().getAttribute('on')).toBeNull();

expect(menu.find('MenuItem').length).toBe(2);

menu.find('MenuItem').find('a').at(1).simulate('click');
Expand Down

0 comments on commit d5c1802

Please sign in to comment.