Thank you, actually I have another question. We us...
# kvision
t
Thank you, actually I have another question. We use navbar but we have an issue with closing menus. When I click on a menu I would expect other opened menu to close, but the stay open.
r
Use
collapseOnClick = true
t
I think there is a bug in collapseOnClick option, it seems it uses different css selectors than dropdowns use.
Copy code
if (collapseOnClick) {
            setInternalEventListener<Navbar> {
                click = {
                    val target = jQuery(it.target)
                    if (target.`is`("a.nav-item.nav-link")) {
                        val navbar = target.parents("nav.navbar").first()
                        val toggler = navbar.children("button.navbar-toggler")
                        val collapse = navbar.children("div.navbar-collapse")
                        if (collapse.`is`(".show")) toggler.click()
                    }
                }
            }
        }
but dropdown has class
dropdown-toggle
r
do you set
forNavbar = true
property when using
DropDown
inside
NavBar
?
t
I do
r
I'll check this out later today
A question - are we talking about collapsed navbar menu? or about a dropdown component put inside a navbar?
t
a dropdown inside navbar
r
I see. That's why it doesn't work. The
collapseOnClick
property is for navbar menu.
The dropdown component is a different case.
But we can definitely fix this with a similar approach
Adding
collapseOnClick
property for a
DropDown
component
Please fill an issue for this as well.
t
Just to make sure. The issue is that I have multiple dropdowns in navbar and when I open one I would like to close others
r
So you just want a dropdown menu. I will think what can be done about this.
t
We already use it
r
I think it should be possible but it will take some hacking ;-)
t
🙂
r
Right now I can't even propose a workaround because I have
stopPropagation
on the click event in the DropDownButton.
t
I know.
r
But I'll try to fix this during the weekend.
t
Anyway, could you give me quick brief how to setup KVision for contributing?
r
t
ahh, sorry I missed it.
r
It should work the way described, at least until you try to edit npm resources
If you will need to modify css files let me know - I'll try to describe how to do it (at least how I do it ;-)
t
Thank you I'll try it