Skip to content

bootstrap.js dependency #197

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

Open
frontsideair opened this issue Jan 4, 2016 · 16 comments
Open

bootstrap.js dependency #197

frontsideair opened this issue Jan 4, 2016 · 16 comments

Comments

@frontsideair
Copy link
Contributor

I noticed that we need bootstrap.js as a global runtime dependency as the pagination size dropdown functionality depends on a data-toggle property which is provided by Bootstrap JS code. I'm considering moving that functionality to React as a way to remove this global dependency.

If there is anyplace else using bootstrap.js that you can point out, I'll keep that in mind when doing that.

@AllenFang
Copy link
Owner

@frontsideair, thanks for this issue report, I almost forgot that we need bootstrap.js as a global dependency. As far as I know, this dependency is just only for pagination size dropdown.

Anyway, how do you add bootstrap dependency, use npm? or any idea to solve this problem

@frontsideair
Copy link
Contributor Author

At first I just included it in the HTML with a <script> tag, but then I realized since I use webpack's code splitting feature to emit an app.js and a vendor.js, I added bootstrap to vendor array and it just worked.

Anyway, if it's only used for the dropdown, it'll be easy and totally worth it to implement it with React.

@AllenFang
Copy link
Owner

👍 so is it a good idea to bundle bootstrap.js to react-bootstrap-table in your opinion?(It's just a question)

@frontsideair
Copy link
Contributor Author

Today I was trying to remove jQuery dependency from our stack and stumbled upon this. I'll probably take some time tomorrow to implement dropdown functionality with React and send a PR. If I can't, we'll need to bundle bootstrap.js and jquery.js for everything to work correctly until this is done. :(

@frontsideair
Copy link
Contributor Author

@AllenFang I started working on implementing pagination dropdown functionality with React, but I need some way to handle clicking outside the dropdown to close it. react-onclickoutside worked great for me, is it okay to add it as a dependency? Or do you suggest something else?

@staminaloops
Copy link
Contributor

https://github.com/Pomax/react-onclickoutside/blob/master/decorator.js is so little, I think its way better than jquery + bootstrap.js (my opinion ofc 👍 )

@AllenFang
Copy link
Owner

@frontsideair @staminaloops, I accept your suggestion, it's a good idea 👍

AllenFang added a commit that referenced this issue Jan 25, 2016
AllenFang added a commit that referenced this issue Jan 25, 2016
@CrisLi
Copy link

CrisLi commented Apr 29, 2016

Why revert the commit?

@AllenFang
Copy link
Owner

@CrisLi, #232 (comment)

@AllenFang AllenFang reopened this Apr 29, 2016
@AllenFang
Copy link
Owner

Because there's something missing, so still need to fix. Hope I can solve this in the near future, so just reopen it

@frontsideair
Copy link
Contributor Author

Sorry, I was supposed to do this but life's been hectic lately so I couldn't make time to do it.

@AllenFang
Copy link
Owner

@frontsideair, that's fine, I'll do it :)

@Gennon
Copy link

Gennon commented Aug 1, 2016

You probably don't want the to have the react-bootstrap dependencies, but at least they have a great dropdown that could help solving this issue? https://react-bootstrap.github.io/components.html#btn-dropdowns

https://github.com/react-bootstrap/react-bootstrap/blob/master/src/Dropdown.js

I don't know about most other users, but I use react-bootstrap with my react-bootstrap-table, so having a dependency on react-bootstrap would not have any implications for me. Keep up the good work!

@AllenFang
Copy link
Owner

@Gennon, thanks sharing, I've planned to tackle this issue on v3.0.0. hope we can solve this critical issue !

@patrickgordon
Copy link

It would be great to have this depend on on react-bootstrap or some other solution. Great library, keep up the good work, hope to see a solution for this sometime soon!

@AllenFang
Copy link
Owner

HI @patrickgordon, you can check #497, I've planned to remove it in the future, hope I can solve this dependency issue.
Thanks :)

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

No branches or pull requests

6 participants