Mui Snackbar autoHideDuration gets paused when page/tab is out of focus - reactjs

I've been using MUI Snackbar and its autoHideDuration option but while testing I noticed that when the page is out of focus, like when you go to another tab, it's paused and the snackbar stays displayed until you focus on the page again.
You can even test this out on the MUI page examples: https://mui.com/material-ui/react-snackbar/
Just have two tabs side by side on the screen, trigger the snackbar, click into the other tab and the snackbar will stay displayed until you click back on the MUI page.
Is this just a side effect of some implementation detail that can't be avoided? Any way around this? I can reproduce this in Chrome and FF.

Related

React custom responsiveness and position of modal dialogue on page load

Currently working on a React project, with styled-components. I am trying to make my modal responsive. Like when the page loads, the modal should be fixed just below the "add event" button.
Sadly, it is but when I change screen size, it does NOT move with that button or the page, and remains at that fixed position for different screens, like a normal modal does
Click to view Image
I have tried changing the margins and position, still no difference. The Modal remains as a fixed overlay and is not responsive with the page components.

MUI Swipeable edge drawer - disable drawer opening temporarily on touch

I have implemented the MUI react drawer with a swipeable edge. On mobile, I am seeing two different actions. When I touch the edge, the drawer opens temporarily. When I swipe up on the edge, the drawer opens permanently. I would like to disable the action where the drawer temporarily opens on touch. The reason is that when I swipe up on the edge, the drawer 'flickers' because the two actions are happening at the same time.
Any ideas on how to do this?
To demonstrate this behaviour, I have included the MUI swipeable edge drawer CodeSandbox. The swipe action can be tested by opening inspect tab and toggling the device toolbar.
CodeSandbox
I went through the same issue and found it was solved recently by the MUI team: https://github.com/mui/material-ui/pull/34505

When a Preference is modified through the right side Toolbar Menu Form, the ToastBar message confirmation is shown to the Form beneath it

I have added the possibility to change a Preferences setting directly in the right side Toolbar. It works fine. However, the ToastBar confirmation messages are shown beneath the Toolbar Form rendering it effectively useless...
Is there a way to bring forth the ToastBar messages?
I suggest using useFormLayeredPane(true) when showing the toast. You can toggle this globally using:
ToastBar.getInstance().useFormLayeredPane(true);

Material UI Drawer scrolls background page to top when opening

I am using material-ui as the UI package for an app.
In the app I'm using material-table with a custom infinite scroll.
When a row is clicked, a drawer opens from the right of the webpage.
Once the drawer opens, the background of the drawer (the infinite scroll table and general page) automatically scrolls back to the top of the page.
This makes this page very unfriendly to users.
I've tried the solutions that are mentioned here, but it doesn't seem to work.
I tried to use it like this:
<Drawer ModalProps={{disableRestoreFocus: true}} disableRestoreFocus>{content}</Drawer>
I couldn't find anymore information on material-ui github, or here on stack overflow.
Has anyone encountered this issue or know any other options I can try?
Thanks in advance.
For material-ui v4, you can add this attribute on the drawer component:
disableScrollLock={true}

How do you build a slide-up panel in React Native, which slides up after you click a button?

See image below to see example - when you click the button, the pane should slide up, and you can then close it by clicking into the map, or sliding it back down.
Used github.com/octopitus/rn-sliding-up-panel to solve this.

Resources