Skip to content

Commit

Permalink
Updated component to version 2.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Semantic-Pusher-Robot committed Mar 19, 2018
1 parent 71296a8 commit a8eb98e
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 18 deletions.
7 changes: 6 additions & 1 deletion RELEASE-NOTES.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
### Version 2.3.0 - Feb 19, 2018
### Version 2.3.1 - Mar 19, 2018

- **Dropdown** - Fixed issue in `2.3.0` that could cause multiselect dropdowns initialized by converting `<select>` to not add initial selected options. [#6123](https://github.com/Semantic-Org/Semantic-UI/issues/6123)
- **Dropdown** - Fixed `onChange` missing `text` from callback when dropdown is set to `action: 'select'` [#4183](https://github.com/Semantic-Org/Semantic-UI/issues/4183) [#4510](https://github.com/Semantic-Org/Semantic-UI/issues/4510)

### Version 2.3.0 - Feb 20, 2018

- **Search** - Category results now has `exact` setting matching dropdown for `fullTextSearch` preventing fuzzy search

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
"framework"
],
"license": "MIT",
"version": "2.3.0"
"version": "2.3.1"
}
2 changes: 1 addition & 1 deletion dropdown.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* # Semantic UI 2.3.0 - Dropdown
* # Semantic UI 2.3.1 - Dropdown
* http://github.com/semantic-org/semantic-ui/
*
*
Expand Down
18 changes: 12 additions & 6 deletions dropdown.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* # Semantic UI 2.3.0 - Dropdown
* # Semantic UI 2.3.1 - Dropdown
* http://github.com/semantic-org/semantic-ui/
*
*
Expand All @@ -10,7 +10,7 @@

;(function ($, window, document, undefined) {

"use strict";
'use strict';

window = (typeof window != 'undefined' && window.Math == Math)
? window
Expand Down Expand Up @@ -1617,7 +1617,7 @@ $.fn.dropdown = function(parameters) {
: text
;
if( module.can.activate( $(element) ) ) {
module.set.value(value, $(element));
module.set.value(value, text, $(element));
if(module.is.multiple() && !module.is.allFiltered()) {
return;
}
Expand Down Expand Up @@ -2283,7 +2283,7 @@ $.fn.dropdown = function(parameters) {
var
length = module.get.query().length
;
$search.val( text.substr(0 , length));
$search.val( text.substr(0, length));
},
scrollPosition: function($item, forceScroll) {
var
Expand Down Expand Up @@ -2579,14 +2579,17 @@ $.fn.dropdown = function(parameters) {
escapedValue = module.escape.value(value),
$label
;
if(settings.ignoreCase) {
escapedValue = escapedValue.toLowerCase();
}
$label = $('<a />')
.addClass(className.label)
.attr('data-' + metadata.value, escapedValue)
.html(templates.label(escapedValue, text))
;
$label = settings.onLabelCreate.call($label, escapedValue, text);

if(module.has.value(value)) {
if(module.has.label(value)) {
module.debug('User selection already exists, skipping', escapedValue);
return;
}
Expand Down Expand Up @@ -3043,6 +3046,9 @@ $.fn.dropdown = function(parameters) {
escapedValue = module.escape.value(value),
$labels = $module.find(selector.label)
;
if(settings.ignoreCase) {
escapedValue = escapedValue.toLowerCase();
}
return ($labels.filter('[data-' + metadata.value + '="' + module.escape.string(escapedValue) +'"]').length > 0);
},
maxSelections: function() {
Expand Down Expand Up @@ -3889,7 +3895,7 @@ $.fn.dropdown.settings.templates = {
? 'disabled '
: ''
;
html += '<div class="'+ maybeDisabled +'item" data-value="' + option[fields.value] + '"' + maybeText + '>'
html += '<div class="'+ maybeDisabled +'item" data-value="' + option[fields.value] + '"' + maybeText + '>';
html += option[fields.name];
html += '</div>';
});
Expand Down
2 changes: 1 addition & 1 deletion dropdown.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dropdown.min.js

Large diffs are not rendered by default.

18 changes: 12 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* # Semantic UI 2.3.0 - Dropdown
* # Semantic UI 2.3.1 - Dropdown
* http://github.com/semantic-org/semantic-ui/
*
*
Expand All @@ -10,7 +10,7 @@

;(function ($, window, document, undefined) {

"use strict";
'use strict';

window = (typeof window != 'undefined' && window.Math == Math)
? window
Expand Down Expand Up @@ -1618,7 +1618,7 @@ module.exports = function(parameters) {
: text
;
if( module.can.activate( $(element) ) ) {
module.set.value(value, $(element));
module.set.value(value, text, $(element));
if(module.is.multiple() && !module.is.allFiltered()) {
return;
}
Expand Down Expand Up @@ -2284,7 +2284,7 @@ module.exports = function(parameters) {
var
length = module.get.query().length
;
$search.val( text.substr(0 , length));
$search.val( text.substr(0, length));
},
scrollPosition: function($item, forceScroll) {
var
Expand Down Expand Up @@ -2580,14 +2580,17 @@ module.exports = function(parameters) {
escapedValue = module.escape.value(value),
$label
;
if(settings.ignoreCase) {
escapedValue = escapedValue.toLowerCase();
}
$label = $('<a />')
.addClass(className.label)
.attr('data-' + metadata.value, escapedValue)
.html(templates.label(escapedValue, text))
;
$label = settings.onLabelCreate.call($label, escapedValue, text);

if(module.has.value(value)) {
if(module.has.label(value)) {
module.debug('User selection already exists, skipping', escapedValue);
return;
}
Expand Down Expand Up @@ -3044,6 +3047,9 @@ module.exports = function(parameters) {
escapedValue = module.escape.value(value),
$labels = $module.find(selector.label)
;
if(settings.ignoreCase) {
escapedValue = escapedValue.toLowerCase();
}
return ($labels.filter('[data-' + metadata.value + '="' + module.escape.string(escapedValue) +'"]').length > 0);
},
maxSelections: function() {
Expand Down Expand Up @@ -3890,7 +3896,7 @@ _module.exports.settings.templates = {
? 'disabled '
: ''
;
html += '<div class="'+ maybeDisabled +'item" data-value="' + option[fields.value] + '"' + maybeText + '>'
html += '<div class="'+ maybeDisabled +'item" data-value="' + option[fields.value] + '"' + maybeText + '>';
html += option[fields.name];
html += '</div>';
});
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "semantic-ui-dropdown",
"version": "2.3.0",
"version": "2.3.1",
"title": "Semantic UI - Dropdown",
"description": "Single component release of dropdown",
"homepage": "http://www.semantic-ui.com",
Expand Down

0 comments on commit a8eb98e

Please sign in to comment.