-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
Fix: placeholder width cutting off text #291 #4898
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
Conversation
The width change makes sense but is there any risk that the closest call fails to pick the right element ? If both this.$search and its .select2-search--inline are children of the widget's parent element then it would be safe. I wonder what @kevin-brown meant in the comment that there is no clean fix here #3669 (comment) |
I didn't look deep into the code, but I believe |
} | ||
|
||
this.$search.css('width', width); | ||
this.$search.closest('.select2-search--inline').css('width', widthParent); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be replaced by .parent()
to be sure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you still want to make that change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works fine the way it is, but I can change it if you think .parent()
is a better approach. I'm ok with either.
When is this fix going out? |
It just seems suspicious to me that replacing a calculated value like Surely there must be a reason that it wasn't set to 100% in the first place? By the way, a more conservative patch is suggested in #3292:
I'd be more comfortable merging this, if I understood why it was calculated the way it is, in the first place. |
This doesn't work, since innerWidth returns incorrect value, not 0. It may be bigger than it should, or a fixed 100px. I dunno why it returns that and don't have time to figure out. |
this css works perfect for me (multiple selection, select starts hidden): .select2-container .select2-selection__rendered > *:first-child.select2-search--inline { |
Thanks for that, @ala-musleh. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
The issue is due to a select2 issue [0][1][2][3][4], a workaround that seem good enough for our context has been applied. Part of story #14190: get email notifications on pull requests - first stage [0] select2/select2#4323 [1] select2/select2#291 [2] select2/select2#4898 [3] select2/select2#3817 [4] select2/select2#4776 Change-Id: I2ae52204a41451b74ce40100588eac7ccca9823e
Fixes #381 Solution from select2/select2#4898 (comment)
this problem stil exists on visible elements (not only for hidden ones from closed issues) for multiple select, and that fix works perfect. why it sitll not merged? |
just commenting I still get the same issue on V4.0.13 for multi selects. Using @xander-mu's styling has fixed it for me |
Issue still exists as of now as well on latest version. |
This pull request includes a
Fixes #291, #3669 and other duplicates.