-
Notifications
You must be signed in to change notification settings - Fork 285
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
Remember the previous position #38
Conversation
remember the previous position of the select before it is set to position absolute.
Could you please describe what the issue is? I'm guessing by the code you posted that if you give a |
If the select element is floated, 'position absolute' without setting 'top' and 'left' is not suitable. It could be also defined by css, but since the position already known, an extra css rule does not have to be written. |
Is there a reason to be applying a float to an element that will inevitably be given |
I often style my forms the CSS Drive way. That is the reason for floating the selects. |
@Jako can you please post an example so I can see exactly what issue this is causing? I'm struggling to understand a realistic situation in which this causes a problem. And if the float is causing an issue, why do we not just unfloat it, since it will be given |
You could try it on http://jsfiddle.net/8S8AR/ The span is in the right position but the select is too much left because the label and the selects are floated (Sorry, forgot the labels in my first answers). |
Same here, the select shifts to the left as soon as customSelect is applied (I'm using the CSS framework YAML that also uses the same method for styling "columnar" forms), so the select field can't be used if the mouse is in the right part of .customSelect. Setting the left position of the select to the width of the label makes it work again. It would be nice if customSelect could do this on its own. |
Merged into 0.4.2. Thanks @Jako for the patch |
Now that the plugin has changed to use absolute top/left values, it would be helpful to note in the documentation that a wrapper with |
@oskarrough is the position not set correctly without relative on the container? I am interested in your issue |
Sure, I'll try to explain with a javascript slideshow. Hope it makes sense. Before the javascript is initialized the slideshow consist of just images on top of each other. If each image has a height of 200px, the total height would be 400px. After the slideshow javascript is initialized the total height would be only 200px. If customSelect gets the positioning 'before* the slideshow, it will be wrong after the slideshow.
|
@oskarrough I feel like the positioning patch that was pulled into 0.4.2 may cause more issues than it will solve. I'm wondering if it would be best if we kept it as an option as opposed to copying the |
Well, positioning like the one in 0.4.2 isn't very reliable, that's for sure. Plus what happens when the window is resized etc. It's better to use methods that don't rely on "magic numbers" in this case. So what do we have? a. or? |
A dynamically inserted wrapper with |
I think this issue is causing more issues than it solves. I dynamically insert content above my customSelect. Then when I try to click on it, the clickable area is offset from the visible select. |
This patch basically broke the plugin imo. It solves one problem by creating another. Fortunately, it was easy to remove even from the minified version. I think this issue should be re-opened until it is solved properly. |
I totally agree. I removed it from the minified version i'm using as well. |
I also agree and have been planning to revert or make the positioning an On Wednesday, July 31, 2013, plusplusben wrote:
|
Remember the previous position of the select before it is set to position absolute.