-
-
Notifications
You must be signed in to change notification settings - Fork 2.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
Use undefined object and jQuery trigger method #1356
Conversation
isOptgroup = this.parentNode.tagName === 'OPTGROUP', | ||
isDisabled = this.disabled || (isOptgroup && this.parentNode.disabled); | ||
|
||
if (icon !== '' && isDisabled) { | ||
icon = '<span>' + icon + '</span>'; | ||
} | ||
|
||
if (that.options.hideDisabled && (isDisabled && !isOptgroup || this.parentNode.disabled && isOptgroup)) { | ||
if (that.options.hideDisabled && isDisabled) { |
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 line needs to be that.options.hideDisabled && (isDisabled && !isOptgroup || this.parentNode.disabled && isOptgroup)
. With just that.options.hideDisabled && isDisabled
, if an optgroup has a disabled option in it, the optgroup's header is hidden. I guess we could make a variable called something like isOptgroupDisabled
and set it equal to this.parentNode.disabled && isOptgroup
, and then set the if statement to if (that.options.hideDisabled && (isDisabled && !isOptgroup || isOptgroupDisabled))
.
@caseyjhol better looks now? |
liIndex--; | ||
return; | ||
} | ||
|
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 needs to remain, otherwise disabled options within an optgroup stay visible.
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.
Done.
address some items from #1356
jQuery 3.0 introduced a breaking change in the empty value of multi select boxes. For details, see https://jquery.com/upgrade-guide/3.0/#breaking-change-select-multiple-with-nothing-selected-returns-an-empty-array
address some items from snapappointments#1356
$.fn.trigger
for unification. Deprecate event shorthand methods (jQuery v4, Deprecate event shorthand methods jquery/jquery#3214)