Semantic-UI-Ember icon indicating copy to clipboard operation
Semantic-UI-Ember copied to clipboard

Tabs within reused components

Open manquer opened this issue 7 years ago • 2 comments

The addon suggests implementing tabs using ember routes , I have used this structure in last few projects without issue, However In the current one, I have use case where there is larger component within which tabs have to be shown.

The larger component is reused in multiple routes. using sub routes for each tab is cumbersome and error prone and is not in sync with self contained ember components . In this context (at least in my use case) the current state and history are not required, i.e. using ember routing and/or semantic tab routing are not necessary

Is there better ember way to do this ? or would you consider this as valid use case for a tab component ?

manquer avatar Apr 18 '17 22:04 manquer

The problem with using the actual tabs semantic plugin is it updates your routes. It would mess with embers routing. I'd suggest using query params or just tracking state on the page individually. Thats mainly why we don't recommend tabs is because you now have ember trying to update the routing and semantic.

aaronbhansen avatar Apr 18 '17 22:04 aaronbhansen

thank you for the quick response, I had figured it was because of the routing you have not build component, I hoped there was a simple way to disable the semantic routing :disappointed:

I will build a new component using menus and track the state internally on click trigger active states for different tabs. I guess while this works for me, the emulation cannot really be part of the official library and obviously it will not have all the features in the core module. Once I have usable version, I will post it here for anyone else looking for similar functionality

manquer avatar Apr 18 '17 22:04 manquer