Browse Source

Fixes issue with .data() storing/retrieving values as original type causing mismatch with .val() [string only] #2754 #2755

pull/2755/merge
Jack Lukic 9 years ago
parent
commit
6c178d0168
2 changed files with 17 additions and 13 deletions
  1. 17
      RELEASE-NOTES.md
  2. 13
      src/definitions/modules/dropdown.js

17
RELEASE-NOTES.md

@ -21,6 +21,15 @@
- **List** - Lists can now be `right floated` or `left floated`
- **Menu** - `text menu` now uses padding for hitboxes to make target area for links larger
**[Merged Pull Requests](https://github.com/Semantic-Org/Semantic-UI/issues?q=is%3Aissue+milestone%3A2.1.0+is%3Aclosed)**
- **Menu** - Fixes tabular menu missing variable for background. **Thanks @frontdevde**
- **Sticky** - Sticky now sets width and height with `!important` to avoid inheritance issues in some cases **Thanks @lauri-elevant** #2710
- **Flag** - England flag alias is now correctly set #2770 **Thanks @eduardom**
- **Popup** - Popup will now look for inline popup as any next adjacent sibling #2772 **Thanks @malacalypse**
- **API** - API debug is now `false` by default, like other modules. #2817
- **Dropdown** - Fixed issue where label could not be removed when using a numeric value due to mismatched types #2754 #2755 **Thanks @dgurkaynak**
**[Reported Bugs](https://github.com/Semantic-Org/Semantic-UI/issues?q=is%3Aissue+milestone%3A2.1.0+is%3Aclosed)**
- **Accordion** - Added missing notation for accordion docs #2812
- **Container** - Fix issue with `fluid container` being `100% + gutter` at mobile resolution (causing overflow)
@ -53,14 +62,6 @@
- **Menu** - Fixed hybrid initialization not creating `menu` correctly. Fixed docs example of hybrid `<select>` initialization
- **Dropdown/Tab** - Fixed an instance where `metadata` was not referencing settings metadata value
**[Merged PR](https://github.com/Semantic-Org/Semantic-UI/issues?q=is%3Aissue+milestone%3A2.1.0+is%3Aclosed)**
- **Menu** - Fixes tabular menu missing variable for background. **Thanks @frontdevde**
- **Sticky** - Sticky now sets width and height with `!important` to avoid inheritance issues in some cases **Thanks @lauri-elevant** #2710
- **Flag** - England flag alias is now correctly set #2770 **Thanks @eduardom**
- **Popup** - Popup will now look for inline popup as any next adjacent sibling #2772 **Thanks @malacalypse**
- **API** - API debug is now `false` by default, like other modules. #2817
### Version 2.0.8 - August 10, 2015
**All UI** - This release should fix issues caused when importing individual component using `require` when using [single component repos](https://github.com/Semantic-Org/). See discussion in [#2816](https://github.com/Semantic-Org/Semantic-UI/pull/2816), and previously [#1156](https://github.com/Semantic-Org/Semantic-UI/pull/1156), and [#1878](https://github.com/Semantic-Org/Semantic-UI/pull/1878)

13
src/definitions/modules/dropdown.js

@ -2152,7 +2152,7 @@ $.fn.dropdown = function(parameters) {
else {
module.verbose('Storing value in metadata', value, $input);
if(value !== currentValue) {
$module.data(metadata.value, value);
$module.data(metadata.value, stringValue);
}
}
if(settings.fireOnInit === false && module.is.initialLoad()) {
@ -2597,15 +2597,18 @@ $.fn.dropdown = function(parameters) {
.each(function(){
var
value = $(this).data(metadata.value),
isUserValue = module.is.userValue(value)
stringValue = (typeof value == 'number')
? value.toString()
: value,
isUserValue = module.is.userValue(stringValue)
;
if(isUserValue) {
module.remove.value(value);
module.remove.label(value);
module.remove.value(stringValue);
module.remove.label(stringValue);
}
else {
// selected will also remove label
module.remove.selected(value);
module.remove.selected(stringValue);
}
})
;

Loading…
Cancel
Save