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(ui-shell): fix onclick menu bugs #5274

Merged
merged 6 commits into from
Feb 11, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions packages/react/src/components/UIShell/HeaderMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/

import { ChevronDownGlyph } from '@carbon/icons-react';
import { ChevronDown16 } from '@carbon/icons-react';
import { settings } from 'carbon-components';
import cx from 'classnames';
import React from 'react';
Expand All @@ -16,7 +16,10 @@ import { AriaLabelPropType } from '../../prop-types/AriaPropTypes';
const { prefix } = settings;

const defaultRenderMenuContent = () => (
<ChevronDownGlyph className={`${prefix}--header__menu-arrow`} />
<ChevronDown16
style={{ willChange: 'unset' }}
className={`${prefix}--header__menu-arrow`}
/>
);

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/UIShell/SideNavMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ export class SideNavMenu extends React.Component {
)}
<span className={`${prefix}--side-nav__submenu-title`}>{title}</span>
<SideNavIcon className={`${prefix}--side-nav__submenu-chevron`} small>
<ChevronDown20 />
<ChevronDown20 style={{ willChange: 'unset' }} />
</SideNavIcon>
</button>
<ul className={`${prefix}--side-nav__menu`}>{children}</ul>
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/UIShell/SideNavSwitcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const SideNavSwitcher = React.forwardRef(function SideNavSwitcher(props, ref) {
))}
</select>
<div className={`${prefix}--side-nav__switcher-chevron`}>
<ChevronDown20 />
<ChevronDown20 style={{ willChange: 'unset' }} />
</div>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,38 +21,48 @@ exports[`HeaderMenu should render 1`] = `
tabIndex={0}
>
<defaultRenderMenuContent>
<ForwardRef(ChevronDownGlyph)
<ForwardRef(ChevronDown16)
className="bx--header__menu-arrow"
style={
Object {
"willChange": "unset",
}
}
>
<Icon
className="bx--header__menu-arrow"
height={6}
height={16}
preserveAspectRatio="xMidYMid meet"
viewBox="0 0 10 6"
width={10}
style={
Object {
"willChange": "unset",
}
}
viewBox="0 0 16 16"
width={16}
xmlns="http://www.w3.org/2000/svg"
>
<svg
aria-hidden={true}
className="bx--header__menu-arrow"
focusable="false"
height={6}
height={16}
preserveAspectRatio="xMidYMid meet"
style={
Object {
"willChange": "transform",
"willChange": "unset",
}
}
viewBox="0 0 10 6"
width={10}
viewBox="0 0 16 16"
width={16}
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M5 6L0 1 0.7 0.3 5 4.6 9.3 0.3 10 1z"
d="M8 11L3 6 3.7 5.3 8 9.6 12.3 5.3 13 6z"
/>
</svg>
</Icon>
</ForwardRef(ChevronDownGlyph)>
</ForwardRef(ChevronDown16)>
</defaultRenderMenuContent>
</a>
<ul
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ exports[`SideNavMenu should render 1`] = `
focusable="false"
height="20"
preserveAspectRatio="xMidYMid meet"
style="will-change: transform;"
style="will-change: unset;"
viewBox="0 0 32 32"
width="20"
xmlns="http://www.w3.org/2000/svg"
Expand Down Expand Up @@ -96,10 +96,21 @@ exports[`SideNavMenu should render 1`] = `
<div
className="bx--side-nav__icon bx--side-nav__icon--small bx--side-nav__submenu-chevron"
>
<ForwardRef(ChevronDown20)>
<ForwardRef(ChevronDown20)
style={
Object {
"willChange": "unset",
}
}
>
<Icon
height={20}
preserveAspectRatio="xMidYMid meet"
style={
Object {
"willChange": "unset",
}
}
viewBox="0 0 32 32"
width={20}
xmlns="http://www.w3.org/2000/svg"
Expand All @@ -111,7 +122,7 @@ exports[`SideNavMenu should render 1`] = `
preserveAspectRatio="xMidYMid meet"
style={
Object {
"willChange": "transform",
"willChange": "unset",
}
}
viewBox="0 0 32 32"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,21 @@ exports[`SideNavSwitcher should render 1`] = `
<div
className="bx--side-nav__switcher-chevron"
>
<ForwardRef(ChevronDown20)>
<ForwardRef(ChevronDown20)
style={
Object {
"willChange": "unset",
}
}
>
<Icon
height={20}
preserveAspectRatio="xMidYMid meet"
style={
Object {
"willChange": "unset",
}
}
viewBox="0 0 32 32"
width={20}
xmlns="http://www.w3.org/2000/svg"
Expand All @@ -77,7 +88,7 @@ exports[`SideNavSwitcher should render 1`] = `
preserveAspectRatio="xMidYMid meet"
style={
Object {
"willChange": "transform",
"willChange": "unset",
}
}
viewBox="0 0 32 32"
Expand Down