Skip to content

don't display a hidden input on destroy#2838

Merged
kevin-brown merged 1 commit into
select2:masterfrom
RustyToms:do_not_display_hidden_input
Dec 10, 2014
Merged

don't display a hidden input on destroy#2838
kevin-brown merged 1 commit into
select2:masterfrom
RustyToms:do_not_display_hidden_input

Conversation

@RustyToms

Copy link
Copy Markdown
Contributor

closes #2837

Here is a JSFiddle using select2.js as it is now: http://jsfiddle.net/ckvbwrcp/
It will appear to be fine in Chrome, but if you click the update button in Firefox the styling will change.

This is the same JSFiddle, except using the code in this PR: http://jsfiddle.net/ckvbwrcp/1/
It will work in both Chrome and Firefox.

The change is in the destroy method. A hidden input is detected, and modifications that are only relevant to visible elements are not performed on the hidden input, so the browser will not attempt to display this element using inline styling.

Comment thread select2.js

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will remove the inline "display" styling from the hidden input.

@kevin-brown kevin-brown self-assigned this Dec 2, 2014
@RustyToms

Copy link
Copy Markdown
Contributor Author

@kevin-brown if you merge this PR, could you tag a new release? We use bower, and I won't really be able to deploy this fix and a previous drop-above styling fix that I submitted a couple of weeks ago that has an impact on our app until a release is tagged.

kevin-brown added a commit that referenced this pull request Dec 10, 2014
@kevin-brown
kevin-brown merged commit a11cfdd into select2:master Dec 10, 2014
@kevin-brown kevin-brown removed their assignment Dec 10, 2014
@kevin-brown kevin-brown added this to the 3.5.3 milestone Dec 10, 2014
@kevin-brown

Copy link
Copy Markdown
Member

Looks good.

I can't guarantee when the next 3.x release will be, as the 4.0 release is coming up soon. You won't need to use the hidden input in 4.0.

@RustyToms

Copy link
Copy Markdown
Contributor Author

Thanks @kevin-brown! Yea I saw the 4.0 branch, looks cool. Just a new patch version would be really helpful though, something to put in our bower.json file, a 3.5.3. Because 3.5.2 is breaking for us in Firefox.

@RustyToms

Copy link
Copy Markdown
Contributor Author

Oh, I see you have a 3.5.3 milestone. I'm not familiar with that technique yet. Ok sorry, I don't want to intrude on your processes.

@RustyToms
RustyToms deleted the do_not_display_hidden_input branch September 9, 2015 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants