-
Notifications
You must be signed in to change notification settings - Fork 45
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
Add support for fieldAddonLeft / fieldAddonRight for strap selects #34
base: master
Are you sure you want to change the base?
Conversation
Yes, selects are surprisingly inflexible. Really good stuff. I'll take a look later today. WRT to the 100 % width, that could be a problem depending on how the component is used, but I don't know for sure until i have investigated further. |
Well, that is strange. It works fine, as far as I can see. But the 100 percent width thing is acting very odd. Strangely, the UI-selects drop downs are resized to fill the area, but the strapselects aren't. I am not that well versed with all the CSS tricks that bootstrap employs, but it seems the standard within bootstrap is a 100 percent width, so the 100 percent might not be a problem. |
@TrevorPage : What do you think? I am not sure about this one. |
So just to recap (I'm just thinking this through out loud): What the above changes have basically done is to steal the The identified side effect is that Now, I have looked at ASF's "kitchen sink" example, and I see that the standard ASF Therefore, I'd say it's actually more consistent and correct for ASFDS' selects to have So at the moment I am inclined to suggest that all is correct, and that a single line of custom CSS should be added to the ASFDS demo to remove the 100% width from all form controls, so that the demo layout is fixed. I'm just a little cautious about there being effects I've not thought about. By the way - I only modified the angular-strap templates so far; the other two just looked scary so I didn't bother changing those yet 😊 |
Ok, I will look at this. (btw, for some reason I did not get any notifications on this thread) |
Indeed, the UI-selects look awful. I have tried several times to clean them up, only to realize that I have to go back to how they work now. It is the UI-selects strange habit of selecting the actual data that is the problem. |
Ok, I am not sure that we understand each other, I am talking about that the width of the drop down, the items to select. |
@TrevorPage : Do you think that my point is valid? |
@TrevorPage : Yo. :-) |
I there were some issues in bootstrap with input-group-addon and selects related to webkit. http://getbootstrap.com/components/#input-groups |
Apologies - I have not forgotten this and will ensure I come back and look further. |
@MattiJarvinen-BA : Good to know. |
I'm finally taking a fresh look at this. Recap / notes to selfIt is the strapselect templates that I modified. The strapselect templates make use of AngularStrap's select capability, which is demonstrated at http://mgcrea.github.io/angular-strap/#/selects. In that demo, we see that:
So, the dropdown being (potentially) narrower is existing behaviour and isn't something introduced by the PR; it's just that the difference becomes especially large when the parent button becomes 100% width due to the addition of One solutionThe best solution I can come up with at the moment would be to only apply the |
If you think this sounds good, I will update the PR with that additional template fix, plus with a sentence added on the example page regarding the 100% width that appears on selects with |
Hi! (Yes, please redo the changes against the "develop" branch) |
Oops - for some reason I missed your response; for some reason I don't think I got an email. I will work on redoing the changes against the develop branch as soon as I can. 👍 |
This is my first Github pull request and there is at least one issue I've identified with what I've done, so I won't be offended if you reject this first time round.
The original issue is that Bootstrap doesn't let you use the
input-group-addon
class forselect
s because apparently they cannot be reliably styled. Therefore ASF does not support thefieldAddonLeft
andfieldAddonRight
options for selects. But because ASFDS usesbutton
s, it is possible by modifying the templates. This way, not only text boxes can have these, but selects can, too. Example:I worked on this because I have this use case:
I've only updated the templates for the single and multi strap selects so far. I've expanded the example to demonstrate these options.
The problem I've identified is that, because I've had to add the
form-control
class (which is necessary for Bootstrap to do the addon group styling correctly), all of the selects in the example now occupy 100% width. I can sort of see why this is occurring, but I have not yet spent sufficient time attempting a fix. If this is a tricky issue, one work-around could be to apply theform-control
class only if thefieldAddonLeft
andfieldAddonRight
options are being used.