Fix issue #4275 #4366

Closed
wants to merge 2 commits into
from

Projects

None yet

3 participants

@vinh123456789

Fix issue #4275, when using useLabels: false, dropdown("clear") won't
remove class "active" from "item"

@vinh123456789 vinh123456789 Fix issue #4275
Fix issue #4275, when using useLabels: false, dropdown("clear") won't
remove class "active" from "item"
672b5d4
@davidkuhta

If we're calling module.remove.activeItem(); inside both the if and the else, shouldn't it be brought outside?
Something like:

clear: function() {
  if(module.is.multiple()) {
    module.remove.labels();
  }
  else {
    module.remove.selectedItem();
  }
  module.remove.activeItem();
  module.set.placeholderText();
  module.clearValue();
},
@vinh123456789
vinh123456789 commented Jul 31, 2016 edited

You are right...
This is my first time contributions to a github project, I was so nervous that I would make a mistake, and here is it...

@davidkuhta

Well technically it wasn't a mistake because your code worked, we just refactored. 😄
And whatever way @jlukic goes with this PR, thanks for helping to make Semantic UI better.

@jlukic
Member
jlukic commented Jul 31, 2016 edited

remove labels calls remove values so this would cause values to remove twice when labels are present.

Probably need

clear: function() {
  if(module.is.multiple() && settings.useLabels) {
    module.remove.labels();
  }
  else {
    module.remove.selectedItem();
  }
  module.remove.activeItem();
  module.set.placeholderText();
  module.clearValue();
}
@jlukic jlukic added this to the 2.2.3 milestone Jul 31, 2016
@jlukic jlukic added a commit that referenced this pull request Jul 31, 2016
@jlukic jlukic Fixes uselabels not clearing properly #4366 #4275 ca08f33
@jlukic jlukic closed this Jul 31, 2016
@jlukic
Member
jlukic commented Jul 31, 2016

Confirmed fix

@jlukic jlukic added a commit that referenced this pull request Jul 31, 2016
@jlukic jlukic Fixes disabled radios #4366 0f6d161
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment