Skip to content
Snippets Groups Projects
Commit 5844ca84 authored by Dickson Law's avatar Dickson Law Committed by Chris Beer
Browse files

Fix onEntering and onExit error

Replace the lines responsible for these errors:

```
Warning: Failed prop type: The prop `onEntering` of `ForwardRef(Menu)` is deprecated. Use the `TransitionProps` prop instead.
```

```
Warning: Failed prop type: The prop `onExit` of `ForwardRef(Menu)` is deprecated. Use the `TransitionProps` prop instead.
```
parent ea0b281a
No related branches found
No related tags found
No related merge requests found
......@@ -42,8 +42,10 @@ describe('WindowTopMenu', () => {
expect(wrapper.find(Menu).first().props().anchorEl).toBe(null);
expect(wrapper.find(Menu).first().props().open).toBe(false);
expect(wrapper.find(Menu).first().props().onClose).toBe(handleClose);
expect(wrapper.find(Menu).first().props().onEntering).toBe(toggleDraggingEnabled);
expect(wrapper.find(Menu).first().props().onExit).toBe(toggleDraggingEnabled);
expect(wrapper.find(Menu).first().props().TransitionProps.onEntering)
.toBe(toggleDraggingEnabled);
expect(wrapper.find(Menu).first().props().TransitionProps.onExit)
.toBe(toggleDraggingEnabled);
});
it('passses correct props to <Menu/> when achor element given', () => {
......@@ -54,7 +56,9 @@ describe('WindowTopMenu', () => {
expect(wrapper.find(Menu).first().props().anchorEl).toBe(anchorEl);
expect(wrapper.find(Menu).first().props().open).toBe(true);
expect(wrapper.find(Menu).first().props().onClose).toBe(handleClose);
expect(wrapper.find(Menu).first().props().onEntering).toBe(toggleDraggingEnabled);
expect(wrapper.find(Menu).first().props().onExit).toBe(toggleDraggingEnabled);
expect(wrapper.find(Menu).first().props().TransitionProps.onEntering)
.toBe(toggleDraggingEnabled);
expect(wrapper.find(Menu).first().props().TransitionProps.onExit)
.toBe(toggleDraggingEnabled);
});
});
......@@ -54,7 +54,9 @@ export class WindowList extends Component {
anchorEl={anchorEl}
open={Boolean(anchorEl)}
onClose={handleClose}
onEntering={WindowList.focus2ndListIitem}
TransitionProps={{
onEntering: WindowList.focus2ndListIitem,
}}
>
<ListSubheader role="presentation" selected={false} disabled tabIndex="-1">
{t('openWindows')}
......
......@@ -47,8 +47,10 @@ export class WindowTopMenu extends Component {
getContentAnchorEl={null}
open={Boolean(anchorEl)}
onClose={handleClose}
onEntering={toggleDraggingEnabled}
onExit={toggleDraggingEnabled}
TransitionProps={{
onEntering: toggleDraggingEnabled,
onExit: toggleDraggingEnabled,
}}
orientation="horizontal"
>
<WindowViewSettings windowId={windowId} handleClose={handleClose} />
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment