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

Use heavier selector for select2 #1997

Merged
merged 1 commit into from
Jun 15, 2017
Merged

Conversation

oeN
Copy link

@oeN oeN commented Jun 6, 2017

See Issue #1996

@gmacdougall
Copy link
Member

Looks like a reasonable change. We have a test failure here that looks related.

I'd also like to see a better commit description.

Thanks for looking in to this!

@oeN
Copy link
Author

oeN commented Jun 7, 2017

Thank you! I'm looking to the failure right now.

@oeN
Copy link
Author

oeN commented Jun 7, 2017

@gmacdougall I've tried but I was unable to replicate the error, it seems that the failure spec fails randomly (at least in my environment). Is it possible? Do you know if someone has a problem like this?

With ruby 2.4.0 I was unable to even run the spec because of poltergeist.
With ruby 2.3.0 I'm able to run the spec but it fails randomly most of times because of poltergeist with errors like:

  • Request to 'http://127.0.0.1:62594/admin' failed to reach server, check DNS and/or server status
  • Timed out with the following resources still waiting data:image/png;base64,iVBOR.....

And sometimes the spec pass without problems. Do you have any advice to solve this and get the PR merged?

Thank you!!

@graygilmore
Copy link
Contributor

Should we be using an ID or name? That's what select2/select2#2750 (comment) suggests.

Should allow us to clean up these selectors even more.

@oeN
Copy link
Author

oeN commented Jun 14, 2017

Yes, I have opted for the name selector select instead of the ID to solve this problem quickly and with the minimum amount of code.

@frankie-loves-jesus
Copy link

Wouldn't it be better if we switched to https://github.com/selectize/selectize.js altogether?

@jhawthorn
Copy link
Contributor

jhawthorn commented Jun 14, 2017

There are some good suggestions here, but I think they're all outside the scope of fixing this immediate issue. Many extensions use <select class="select2">, so we'll need that to continue working for the time-being.

I'd love to see us move away from that, to bootstrap's custom-select or similar, but IMO this is a good fix to an immediate issue.

@graygilmore
Copy link
Contributor

graygilmore commented Jun 14, 2017

There are some good suggestions here, but I think they're all outside the scope of fixing this immediate issue. Many extensions use <select class="select2">, so we'll need that to continue working for the time-being.

Sounds good! 👍

It wasn't fully clear to me why this was necessary so I pulled stuff down and tested things out. I think improving the commit message here will go a long way in clarifying things for future-us.

Copy link
Member

@tvdeyen tvdeyen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think improving the commit message here will go a long way in clarifying things for future-us.

Yes, please add some more information in the commit message so future readers know why we made this.

Thanks for the contribution

Using a simple class selector to init select2 will throw an error if there is already an instance of select2 in the page with the same class selector.
@oeN
Copy link
Author

oeN commented Jun 15, 2017

@tvdeyen I've tried to add the information on the commit, let me know if is fine. I thought I had to stay in the character limit 😄

Copy link
Member

@tvdeyen tvdeyen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect. Thanks!

@tvdeyen
Copy link
Member

tvdeyen commented Jun 15, 2017

I thought I had to stay in the character limit

This character only applies to the first sentence. The description body (separated by a new line) can and should be as long as you need to explain the rational behind your changes.

A very good read on this topic is: https://chris.beams.io/posts/git-commit/

@jhawthorn jhawthorn merged commit 67e5c54 into solidusio:master Jun 15, 2017
@oeN oeN deleted the fix-select2 branch June 16, 2017 07:16
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.

6 participants