Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix hide_sidebar option in Companion App #276

Merged
merged 1 commit into from
Sep 21, 2024

Conversation

elchininet
Copy link
Collaborator

@elchininet elchininet commented Sep 21, 2024

When one opens and closes the sidebar, there is a logic behind to manage the Navigation Drawer and its focus trap.

If one hides the sidebar and applies all the styling override that kiosk-modes applies, the logic to remove all the inert blockers from the screen and to set all the elements in a closed state is never executed. This is not a problem for those that set hide_sidebar globally in all the dashboards, but it is a problem if someone wants a dashboard without sidebar and navigates to it from a dashboard with it enabled, because in that moment the logic to close the sidebar is executed and as the sidebar never closes this provokes that it is impossible to interact with the interface.

In this pull request a small fix has been introduced. Before hiding the sidebar, we are checking if the type of the mc-drawer element is modal (it occurs in mobile) and if its appContent has the inert property set in true (in those cases it is impossible to interact with the screen). If that is the case, then we wait for the MDCDrawer:closed event of the Navigation Drawer, and only after it is fired, we apply the styles to hide the sidebar. In the rest of the cases we hide the sidebar directly without waiting for this event.

Closes #275

@elchininet elchininet added the 🐛 bug Something isn't working label Sep 21, 2024
@elchininet elchininet marked this pull request as ready for review September 21, 2024 11:17
@NemesisRE NemesisRE merged commit beeffcd into master Sep 21, 2024
5 checks passed
@NemesisRE NemesisRE deleted the fix_hide_sidebar_companion_app branch September 21, 2024 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Dashboard in kiosk mode in read only mode
2 participants