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

EUISideNav: Ability to force nav subtree to be open even when not selected. #497

Closed
arkwright opened this issue Mar 12, 2018 · 3 comments · Fixed by #515
Closed

EUISideNav: Ability to force nav subtree to be open even when not selected. #497

arkwright opened this issue Mar 12, 2018 · 3 comments · Fixed by #515

Comments

@arkwright
Copy link
Contributor

Based on feedback from usability testing, we would like to implement an EUISideNav for which certain subtrees are always open. The user would not need to click to expand some levels of the tree. Currently this appears to be impossible without forcing item.isSelected = true, which feels like an abuse of semantics.

I have a proof-of-concept implementation which adds an isOpen property to the item objects passed to EUISideNav. When item.isOpen = true, it would trump item.isSelected and force that level of the navigation to be open. Other selection functionality should be preserved. This approach would allow for opening the entire menu by default, or only specific subtrees (our use case).

item.isOpen = undefined // Defer to item.isSelected (default).
item.isOpen = true      // Force this level of the menu to be open.
item.isOpen = false     // Force this level of the menu to be closed.

I could also see .isOpen being renamed to .forceOpen.

@cjcenizal, @snide: @andrew-moldovan and I are interested in your thoughts on this proposal. If this sounds good, I'll package everything up in a PR.

@snide
Copy link
Contributor

snide commented Mar 12, 2018

As long as its an optional prop that is set off by default it sounds ok to me. Generally @cjcenizal has been prefixing such things with initial... initialIsOpen

@arkwright
Copy link
Contributor Author

Cool!

Interesting point re: initial. If we went with that prefix, I would expect the menu to only be open initially, that is, until the user interacts with it. I'll have to take another look at the code to see if it's worth implementing that way. I could also imagine a future wherein we really would want some menus to be always open, even post-interaction.

@cjcenizal
Copy link
Contributor

@arkwright Your idea sounds great, and isOpen sounds like the right name for that property. I agree with you that if we prefixed it with initial, we'd expect it to be open at first and then the user would be able to interact with it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants