Skip to content

Commit

Permalink
Fixes #4490 - Dropdown with search inside menu should be tabbable. Fi…
Browse files Browse the repository at this point in the history
…xes issue with selectOnKeydown and html text
  • Loading branch information
jlukic committed Dec 29, 2016
1 parent bfea105 commit 9006d4c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
3 changes: 3 additions & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,16 @@
**Critical Bugs**
- **Dropdown/Search/Checkbox** - Removes use of deprecated
- **Dropdown** - `forceSelection` will no longer select value in `multiple selection dropdown` #4041 #4516
- **Dropdown** - Fix issue where `dropdown` with `search` in menu are not tabbable #4490
- **Search** - Fixes issue where search will re-appear with incorrect results when using `show `showNoResults: false` to hide no results messages. #4616


**Bugs**
- **Button** - Fixed issue where css specificity caused `icon buttons` to not center correctly #4487
- **Dropdown** - Fixed bug where clicking `dropdown icon` using remote data would cause nothing to happen #4041
- **Dropdown** - Fix bug where `scrolling menu` or `scrolling dropdown` would have excessive right padding by removing scrollbar width from calculation (no longer necessary in modern browsers)
- **Comments** - `small`, `large` and other comment sizes now default to global size variables.
- **Dropdown** - Fixed issue where `selectOnKeydown` with `html` content would cause only non html content to display in `text` until blur

**Documentation**
- **Visibility** - Added documentation for `onOnscreen` and `onOffScreen` to important callbacks somehow omitted from docs
Expand Down
22 changes: 16 additions & 6 deletions src/definitions/modules/dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -621,8 +621,17 @@ $.fn.dropdown = function(parameters) {
.on('mousedown' + eventNamespace, module.event.mousedown)
.on('mouseup' + eventNamespace, module.event.mouseup)
.on('focus' + eventNamespace, module.event.focus)
.on('blur' + eventNamespace, module.event.blur)
;
if(module.has.menuSearch() ) {
$module
.on('blur' + eventNamespace, selector.search, module.event.search.blur)
;
}
else {
$module
.on('blur' + eventNamespace, module.event.blur)
;
}
}
$menu
.on('mouseenter' + eventNamespace, selector.item, module.event.item.mouseenter)
Expand Down Expand Up @@ -2190,7 +2199,7 @@ $.fn.dropdown = function(parameters) {
$text.addClass(className.placeholder);
},
tabbable: function() {
if( module.has.search() ) {
if( module.is.searchSelection() ) {
module.debug('Added tabindex to searchable dropdown');
$search
.val('')
Expand Down Expand Up @@ -2302,12 +2311,13 @@ $.fn.dropdown = function(parameters) {
},
selectedItem: function($item) {
var
value = module.get.choiceValue($item),
text = module.get.choiceText($item, false)
value = module.get.choiceValue($item),
searchText = module.get.choiceText($item, false),
text = module.get.choiceText($item, true)
;
module.debug('Setting user selection to item', $item);
module.remove.activeItem();
module.set.partialSearch(text);
module.set.partialSearch(searchText);
module.set.activeItem($item);
module.set.selected(value, $item);
module.set.text(text);
Expand Down Expand Up @@ -2896,7 +2906,7 @@ $.fn.dropdown = function(parameters) {
;
},
tabbable: function() {
if( module.has.search() ) {
if( module.is.searchSelection() ) {
module.debug('Searchable dropdown initialized');
$search
.removeAttr('tabindex')
Expand Down

0 comments on commit 9006d4c

Please sign in to comment.