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
Question: How to use it with ng-bootstrap's tabset? #10
Comments
Hi @tommykamkcm, I'd love to do what ever I can for help, can you provide some of your code? |
Thanks for your prompt response! First of all, I only have some experience on Angular1 and I am a newbie to Angular2. So I am not sure what I'm trying to do is possible or not: So below is the HTML code for generating the ng-bootstrap's Tabset component: https://ng-bootstrap.github.io/#/components/tabs
and eventually it becomes
So what I've tried to do is adding And as expected, it does not work probably because the Since the first try does not seem to work, I am now thinking if we can inject the DragScroll component into
That's all the info so far I've got. Thank you very much for your time! |
Hello @bfwg, Finally got it working! Basically, I need to manually
I also have a little suggestion (though I'm not sure if it is a good idea or not): use Angular2's Finally, appreciate your effort and hopefully my findings / suggestion are useful! |
@tommykamkcm Thanks for reporting this, I have updated the library to use |
hello @bfwg, sorry for being annoying but I just found that what I've done yesterday is actually affecting other components e.g. . What I suggest to do is: bind
After doing this, only 2 steps are required for the initialisation:
constructor(...) {} Finally, it would be really good if you could compile the source code and make it available for |
Ah, I see what you mean. I will update the source some time today and upload to npm, thanks again for reporting this. |
Hey @tommykamkcm , I just realized |
hello @bfwg, maybe let's take a step back and think about different use cases. My use case is to make a long horizontal menu drag-scrollable by mouse or finger. Everything was going well until I dragged on an HTML5 slider, which is mousemove sensitive. I could click and drag, but not release the handle after it reached the correct position. So to me what I expect are a) user. always drag inside the drag zone i.e. the menu b) other components on the page should not be affected by the plugin. and your use case probably is as long as users hold and move the mouse, they should be able to drag and see a certain part of the content easily (drag zone = I'm sure that there will be more and more use cases and I reckon making drag zone configurable [self|default:document] will probably be the way to go. |
Hi @tommykamkcm , I think we can definitely fix this. I'm going to test with ng-bootstrap's tabset and see if I can reproduce. |
Hi @tommykamkcm, I have put the below code in the demo app html template. <ngb-tabset>
<ngb-tab title="Simple">
<ng-template ngbTabContent>
<p>Raw denim you probably haven't heard of them jean shorts Austin. Nesciunt tofu stumptown aliqua, retro synth
master cleanse. Mustache cliche tempor, williamsburg carles vegan helvetica. Reprehenderit butcher retro keffiyeh
dreamcatcher synth. Cosby sweater eu banh mi, qui irure terry richardson ex squid. Aliquip placeat salvia cillum
iphone. Seitan aliquip quis cardigan american apparel, butcher voluptate nisi qui.</p>
</ng-template>
</ngb-tab>
<ngb-tab>
<ng-template ngbTabTitle><b>Fancy</b> title</ng-template>
<ng-template ngbTabContent>Food truck fixie locavore, accusamus mcsweeney's marfa nulla single-origin coffee squid.
<div class="demo-one" drag-scroll drag-scroll-y-disabled="true" scrollbar-hidden="true" >
<img *ngFor="let image of imagelist" [src]="'assets/img/' + image" />
</div>
</ng-template>
</ngb-tab>
</ngb-tabset> The drag list worked as expected. Can you provide more detail about your html code please? |
hello @bfwg sorry for the long silence. What I'm trying to do is actually apply the plugin to the |
No worries @tommykamkcm , I see, you are trying to append the directive after the component is rendered. Let me try that tomorrow and I'll get back to you as soon as I can. |
@tommykamkcm Sorry for the delay response. I have played with |
No worries @bfwg, everyone should relax as long as there is a hack and it works. It would be also good if we could have a method that does the hack, in other words, dynamically apply the plugin to a DOM element! Anyway, thanks again for your support! Really appreciate it! |
Hey @tommykamkcm , I'm working the
It is almost done, would you like to review the Pull request once it is ready? |
Hello @bfwg no worries, I really appreciate your help! Just read your code and everything looks good! Thanks again! |
Hi @tommykamkcm / @bfwg Can you please drop the Demo for ngb-tabs with scroll Thanks |
Hello, just found this plugin from google.
I found it really useful for the site navigation menu which is very long. However, the menu is built with ngb-tabset (one of the ng-bootstrap's components) and I am not sure how to inject your plugin into the tabset component.
It would be really good if can give me some advice! Thanks a lot!
The text was updated successfully, but these errors were encountered: