Skip to content

Instantly share code, notes, and snippets.

@zmts
Created January 10, 2017 12:55
Show Gist options
  • Save zmts/d4c82513cf432b0a89a89d45bd5b6e10 to your computer and use it in GitHub Desktop.
Save zmts/d4c82513cf432b0a89a89d45bd5b6e10 to your computer and use it in GitHub Desktop.
select2 "required problem" solution
<div class="select2-wrapper">
<select required>
...
</select>
</div>
<style>
.select2-offscreen,
.select2-offscreen:focus {
clip: rect(0 0 0 0) !important;
/* The message is squashed and not seen.*/
/* width: 1px !important;*/
/* height: 1px !important;*/
border: 0 !important;
margin: 0 !important;
padding: 0 !important;
overflow: hidden !important;
position: absolute !important;
outline: 0 !important;
left: 0px !important;
top: 0px !important;
}
.select2-wrapper {
position: relative;
}
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment