Fix unknonw div props in context menu (#9277)
This commit is contained in:
parent
eace4d6894
commit
41960b164b
2 changed files with 8 additions and 3 deletions
|
@ -397,6 +397,13 @@ export default class ContextMenu extends React.PureComponent<IProps, IState> {
|
||||||
</FocusLock>;
|
</FocusLock>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// filter props that are invalid for DOM elements
|
||||||
|
const {
|
||||||
|
hasBackground: _hasBackground, // eslint-disable-line @typescript-eslint/no-unused-vars
|
||||||
|
onFinished: _onFinished, // eslint-disable-line @typescript-eslint/no-unused-vars
|
||||||
|
...divProps
|
||||||
|
} = props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<RovingTabIndexProvider handleHomeEnd handleUpDown onKeyDown={this.onKeyDown}>
|
<RovingTabIndexProvider handleHomeEnd handleUpDown onKeyDown={this.onKeyDown}>
|
||||||
{ ({ onKeyDownHandler }) => (
|
{ ({ onKeyDownHandler }) => (
|
||||||
|
@ -413,7 +420,7 @@ export default class ContextMenu extends React.PureComponent<IProps, IState> {
|
||||||
style={menuStyle}
|
style={menuStyle}
|
||||||
ref={this.collectContextMenuRect}
|
ref={this.collectContextMenuRect}
|
||||||
role={managed ? "menu" : undefined}
|
role={managed ? "menu" : undefined}
|
||||||
{...props}
|
{...divProps}
|
||||||
>
|
>
|
||||||
{ body }
|
{ body }
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -194,8 +194,6 @@ exports[`<SpaceContextMenu /> renders menu correctly 1`] = `
|
||||||
/>
|
/>
|
||||||
<div
|
<div
|
||||||
className="mx_ContextualMenu"
|
className="mx_ContextualMenu"
|
||||||
hasBackground={true}
|
|
||||||
onFinished={[MockFunction]}
|
|
||||||
role="menu"
|
role="menu"
|
||||||
style={Object {}}
|
style={Object {}}
|
||||||
>
|
>
|
||||||
|
|
Loading…
Reference in a new issue