-
Notifications
You must be signed in to change notification settings - Fork 264
Drop down shift when close to the right of the screen. #180
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
Comments
I'm not sure what problem you are referring to. I have noticed some nub positioning weirdness. Repositioning the drop down like this does not solve it though. |
I mixed up things. Please ignore my first explanation and I will try again. When the dropdown is too close to the right side of the window, there is a threshold (rightThreshold) that its job is to re-position the dropdown from the right side (it moves also the arrow to the right). The problem is that the way it calc the "left" variable in this situation (I think) is wrong. The problem is that it's actually should take the original "left" and reduce the width of the dropdown plus 2 times the arrow shift (2 * 8px). So I think the right fix will be: |
This is what happens when you do that: |
Without the change the dropdown will just be on the right of the screen. |
It looks like a better solution might be: |
You are right. On Thu, Jan 15, 2015 at 12:54 PM, Rickert Mulder [email protected]
|
Thanks for the workaround. Is there a PR for this? |
There is a problem with dropdown that is too close to the right of the screen.
the fix is to reduce dropdownWidth/2 from the left size (line #462 on v0.51):
==> left = rightThreshold - dropdownWidth/2;
The all part:
var left = Math.round(offset.left - parentOffset.left);
var rightThreshold = $window.innerWidth - dropdownWidth - 8;
if (left > rightThreshold) {
left = rightThreshold - dropdownWidth/2;
dropdown.removeClass('left').addClass('right');
}
The text was updated successfully, but these errors were encountered: