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/dojo-bootstrap-tab-issue #168

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

apatriz
Copy link
Contributor

@apatriz apatriz commented Jul 3, 2017

I've been looking into an issue with dropdown menu items with the data-toggle="tab" attr staying highlighted indefinitely after clicked in a CMV application. The issue #158 seems to relate this to a dojo issue within the dijit MenuItem class.

While that solution may work, I've looked into it further and it looks like it's simply an issue with dojo-bootstrap Tab.js not selecting the dropdown-menu container by design (Tab.js line 40). You can test this by adding the data-toggle="tab" attr to any anchor element in the dropdown menu, which would normally be the way to manage tab (or panel) active state in bootstrap.
But we are using a dropdown menu and not 'tabs' in the bootstrap sense, so menu items will stay active because Tab is ignoring the parent

    container. Again, this is by design based on how bootstrap tabs work normally.

    So to emulate the active state management of tabs in bootstrap, it means that in addition to managing the active state of panels, we should manage the menu item active state as well.

@alaframboise
Copy link
Contributor

Finally getting to this now...

@alaframboise
Copy link
Contributor

@apatriz if you close the panel manually we should probably unselect(unactivate) the menu item.

@apatriz
Copy link
Contributor Author

apatriz commented Jul 20, 2017

good call @alaframboise

@alaframboise
Copy link
Contributor

What test app are you using? I can't seem to get any of the li's to stay active. I believe this is failing:

https://github.com/Esri/calcite-maps/pull/168/files#diff-bae3f3a6daabc5281032afae882a69faR80

@apatriz
Copy link
Contributor Author

apatriz commented Jul 26, 2017

You're right, I tested again quickly last night and i ran into unexpected behavior in the 4.x sample app
I tested mostly in the 3.x sample app before. I'll look into it some more

…ap tabs. add active-panel css class to differentiate bootstrap tab active status from panel active status
@apatriz
Copy link
Contributor Author

apatriz commented Jul 30, 2017

I think I've fixed it. Tested in all the sample apps. This is a better solution than my last attempt in my opinion -- it allows managing active status for real bootstrap tabs (like Map and Scene in the sample apps) as well as calcite-maps panels in the same dropdown menu. It will work if using 'data-toggle=tab' on panel menu items as well.

@alaframboise
Copy link
Contributor

If a panel is active on start-up, the menu UI isn't in sync.

@alaframboise
Copy link
Contributor

And we also need the jQuery equivalent.

@apatriz
Copy link
Contributor Author

apatriz commented Aug 6, 2017

i'll get to the jQuery version at some point :)

@alaframboise
Copy link
Contributor

Waiting on jQuery solutions to match dojo.

@apatriz
Copy link
Contributor Author

apatriz commented Oct 12, 2017

I added the jQuery implementation in my last set of commits here -- forgot to mention it!

@apatriz
Copy link
Contributor Author

apatriz commented Nov 23, 2017 via email

@alaframboise
Copy link
Contributor

@apatriz finally getting back to this. I think this implementation is confusing - to have an active tab and menu item based on the active panel.

image

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

Successfully merging this pull request may close these issues.

None yet

2 participants