-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Material Select "offsets" text when leading or trailing whitespace is present #3249
Open
Labels
Comments
Same problem here... Is an official fix coming? |
I fixed this once for me by simply adding Line 365 in 4a68ebd
I'll have a look at it tomorrow :) |
dargmuesli
added a commit
to dargmuesli/jonas-thelemann
that referenced
this issue
Sep 27, 2018
richarddewit
added a commit
to richarddewit/materialize
that referenced
this issue
Mar 31, 2021
A fix provided in Dogfalo#6142 to fix Dogfalo#3249
Fixed on materializecss#100 |
bugy
pushed a commit
to bugy/materialize
that referenced
this issue
Oct 3, 2021
A fix provided in Dogfalo#6142 to fix Dogfalo#3249
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When creating a Select element with the following markup
the JavaScript will interpret the HTML including the whitespace leading the text "English" and "Romulan" and append it to the generated
span
element. This causes the selected option text to be offset by X amount of whitespace producing the Codepen belowThe offending JavaScript file seems to be:
https://github.com/Dogfalo/materialize/blob/f7390445388813882d3b6948b0f034dec3eb700a/js/forms.js
And offending lines: L416, L418, L425, L427
The fix "could" be a simple
.trim()
on the HTML to rid the leading and trailing whitespace.Codepen for not working scenario: http://codepen.io/webhenrik/pen/mEPOwx
Codepen for working scenario: http://codepen.io/webhenrik/pen/jrqVwo
The text was updated successfully, but these errors were encountered: