coreui-react
coreui-react copied to clipboard
CSidebar - hides after zooming in and does not come back after setting standard zoom
Systems:
Ubuntu
- Version: 20.04
- Chrome Version 103.0.5060.134
Windows
- Version 10 Pro 21H2
- Chrome Version 103.0.5060.114
Steps to repeat:
- Go to page - https://coreui.io/demos/react/4.3/dark/#/dashboard
- Zoom in on the page until the sidebar disappears
- Revert zoom to it is original state
Expected: Sidebar hides when zoomed in and returns when zoomed in to standard
Actual: Sidebar hides when zoomed in and not returns when zoomed in to standard
Hi, I confirm the same problem.
Another issue possibly related, is that after you increase the window size, the sidebar element gets the 'hide' css class added to it, which is why you have to click twice on the hamburger button to open it again.
I did some digging and it seems to be this part of the code.
useEffect(() => {
mobile && visible && setVisible(false);
}, [mobile])
making it as follows resolves both problems:
useEffect(() => {
mobile && _visible && setVisible(false);
!mobile && !_visible && setVisible(true);
}, [mobile])
This also happens on high-resolution screens with a zoomed in DPI. e.g. 4k screens with 150% DPI.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions
This is still an issue and seemingly solved by the single line edit above.