@danielgindi/selectbox 2.0.49 → 2.0.50

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/SelectBox.js CHANGED
@@ -1479,7 +1479,8 @@ class SelectBox {
1479
1479
 
1480
1480
  this._trigger('open:before', { list: p.dropList });
1481
1481
 
1482
- p.lastActiveElement = document.activeElement === document.body ? null : getFocusState(document.activeElement);
1482
+ if (document.activeElement !== p.input)
1483
+ p.lastActiveElement = document.activeElement === document.body ? null : getFocusState(document.activeElement);
1483
1484
 
1484
1485
  // Propagate direction to droplist
1485
1486
  p.dropList.setDirection(getComputedStyle(p.el).direction);
@@ -1516,7 +1517,8 @@ class SelectBox {
1516
1517
  p.dropList.hide();
1517
1518
 
1518
1519
  if (p.lastActiveElement) {
1519
- restoreFocusState(p.lastActiveElement);
1520
+ if (!p.multi && !p.searchable)
1521
+ restoreFocusState(p.lastActiveElement);
1520
1522
  p.lastActiveElement = null;
1521
1523
  }
1522
1524
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danielgindi/selectbox",
3
- "version": "2.0.49",
3
+ "version": "2.0.50",
4
4
  "description": "A collection of dom utilities. So you can work natively with the dom without dom frameworks.",
5
5
  "main": "dist/lib.cjs.min.js",
6
6
  "module": "lib/index.js",