When the control is used as RTL the way to hide the drop-down list is to put it on positive 9000px and when used in LTR -9000px is use
Fix chosen.jquery.js in-script CSS when the control is used in RTL state
I'm not suer why the cake build change this from _ref to _ref1
@ido-ran Sorry for the late reply. Could you give a reason for why this 'fix' is necessary? I just don't see it. Thanks.
@kenearley Browsers with languages that use left-to-right languages (like English) will ignore any content with a negative left position when calculating dimensions for scrollbars, but will show huge scrollbars for content off the right edge of the screen. Browsers set to use right-to-left languages (like Hebrew) will reverse it.
TL;DR People using Chosen and the RTL setting get nasty scrollbars.
I actually wonder what happens if we use a negative top position. If we just set it to top: -9999px do scrollbars get janky? This would diminish the need for a conditional.
When using chosen in right-to-left page the css that cause the the drop-down to be hidden need to use positive 9000 as left while left-to-right need to use negative 9000.
That's all this fix is about.
@pfiller @ido-ran I've not been able to reproduce any issue. I did mess around with negative top and it was causing the page to jump.
@ido-ran If you could provide an example of the issue jsFiddle, I will take a look at this again. Thanks.
Here you go : Problem´s fiddle :
all you have to do is define dir="rtl"
Just look at the bottom of the page ( before opening the select menu.. )
You can also see a screenshot here in another issue opened here : #1056
This was tested on several firefox version, opera and chrome.
Might be that it depends on browser /os , but I had definitely encountered this problem on every single use.
@krembo99 Thanks. I'll take a look.
@kenearley you should also have a look at : https://github.com/harvesthq/chosen/pull/956/files (forgot to Link before)
Thank you @krembo99 for betting me to the sample.
I don't believe this PR solves the problem. This is what I see in the example page:
I think the example page is not a good page to test whether or not this is solved. People are not likely to be mixing both styles of chosen (right to left and left to right). The example page is set up to show multiple types of Chosen options and is, therefore, abnormal.
It seems like the solution should not cause it even when mixed, but I'll test the PR with only rtl.
Closing this PR in favor of #1159