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 jQuery selector from premature selection of span element in inline/embedded calendar's month selection #1859

Merged
merged 1 commit into from
May 9, 2016

Conversation

kerryj89
Copy link

@kerryj89 kerryj89 commented Apr 17, 2016

With the templating system, we are now able to define the left and right arrows. Users may end up using font icons that typically follow the common empty span with icon class name: <span class="icon-right-arrow"></span>.

While the font icons show as expected, they are being prematurely selected by jQuery since the code assumes only span elements will only exist for the month listing and not the next/prev arrows which by default are characters. You can replicate this by selecting a date in the below jsfiddle, and then clicking on the month name to enter the month listing. You will see that the active class incorrectly applies itself two months before the actual active month. A similar (same?) issue appeared on the original bootstrap-datepicker smalot/bootstrap-datetimepicker#277

https://jsfiddle.net/rgjsq9bL/

All I've done was retarget the troubled selector to only look for span elements within tbody.

@kerryj89 kerryj89 changed the title Retarget active selector to be more specific for inline/embed month view Fix jQuery selector from premature selection of span element in inline/embedded calendar's month selection Apr 17, 2016
@vsn4ik
Copy link
Member

vsn4ik commented Apr 22, 2016

Also need to add the test.

@acrobat
Copy link
Member

acrobat commented Apr 28, 2016

@kerryj89 can you add some tests for this change? Then the PR should be ready to be merged!

@kerryj89
Copy link
Author

kerryj89 commented May 2, 2016

@acrobat I've never done tests before so I will sit down this weekend and learn how to make one. Sorry!

@acrobat
Copy link
Member

acrobat commented May 3, 2016

Ok, thanks @kerryj89!

@vsn4ik vsn4ik mentioned this pull request May 9, 2016
@acrobat acrobat added this to the 1.7.0 milestone May 9, 2016
@acrobat
Copy link
Member

acrobat commented May 9, 2016

Thanks @kerryj89

@acrobat acrobat merged commit 6657b91 into uxsolutions:master May 9, 2016
@acrobat acrobat mentioned this pull request May 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants