Skip to content
Snippets Groups Projects
Commit ce0aba26 authored by esikkala's avatar esikkala
Browse files

Deactivate tabs properly

parent 8ef8a82b
No related branches found
No related tags found
No related merge requests found
......@@ -35,6 +35,7 @@ const PerspectiveTabs = props => {
// "MUI: The `value` provided to the Tabs component is invalid.
// The Tab with this `value` ("0") is not part of the document layout.
// Make sure the tab item is present in the document or that it's not `display: none`.""
// https://github.com/mui-org/material-ui/issues/29209
const timer = setTimeout(() => setCurrentTab(pathnameToTabValue(location, tabs)), 1000)
// clear timeout when component unmounts
......@@ -45,8 +46,9 @@ const PerspectiveTabs = props => {
[location]
)
// always deactivate tabs, until the useEffect hook sets the value
const handleChange = (event, newValue) => {
setCurrentTab(newValue)
setCurrentTab(false)
}
return (
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment