Browse Source

Fix bug in search related to DOM fragment removed from document

pull/4625/head
Jack Lukic 8 years ago
parent
commit
b8a14c2917
2 changed files with 9 additions and 1 deletions
  1. 1
      RELEASE-NOTES.md
  2. 9
      src/definitions/modules/search.js

1
RELEASE-NOTES.md

@ -4,6 +4,7 @@
**Bugs**
- **Search** - Fixed issue where pressing "up" key when no results selected would cause bottom result to be selected
- **Search** - Fixed issue where input may attempt to refocus when element is immediately removed from browser's DOM after a result is clicked
**Enhancements**
- **Checkbox** - Adds additional variables for styling toggle checkbox on/off state

9
src/definitions/modules/search.js

@ -366,7 +366,14 @@ $.fn.search = function(parameters) {
return $results.hasClass(className.hidden);
},
inMessage: function(event) {
return (event.target && $(event.target).closest(selector.message).length > 0);
if(!event.target) {
return;
}
var
$target = $(event.target),
isInDOM = $.contains(document.documentElement, event.target)
;
return (isInDOM && $target.closest(selector.message).length > 0);
},
empty: function() {
return ($results.html() === '');

Loading…
Cancel
Save