Skip to content

Commit

Permalink
add white-space: pre for search field scaling (#2714)
Browse files Browse the repository at this point in the history
this prevents spaces to be collapsed

fixes #791
  • Loading branch information
koenpunt authored Oct 5, 2016
1 parent a532197 commit 7259f35
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions coffee/chosen.jquery.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -491,8 +491,8 @@ class Chosen extends AbstractChosen
h = 0
w = 0

style_block = "position:absolute; left: -1000px; top: -1000px; display:none;"
styles = ['font-size','font-style', 'font-weight', 'font-family','line-height', 'text-transform', 'letter-spacing']
style_block = "position:absolute; left: -1000px; top: -1000px; display: none; white-space: pre;"
styles = ['font-size', 'font-style', 'font-weight', 'font-family', 'line-height', 'text-transform', 'letter-spacing']

for style in styles
style_block += style + ":" + @search_field.css(style) + ";"
Expand Down
4 changes: 2 additions & 2 deletions coffee/chosen.proto.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -486,8 +486,8 @@ class @Chosen extends AbstractChosen
h = 0
w = 0

style_block = "position:absolute; left: -1000px; top: -1000px; display:none;"
styles = ['font-size','font-style', 'font-weight', 'font-family','line-height', 'text-transform', 'letter-spacing']
style_block = "position:absolute; left: -1000px; top: -1000px; display: none; white-space: pre;"
styles = ['font-size', 'font-style', 'font-weight', 'font-family', 'line-height', 'text-transform', 'letter-spacing']

for style in styles
style_block += style + ":" + @search_field.getStyle(style) + ";"
Expand Down

0 comments on commit 7259f35

Please sign in to comment.