@neovici/cosmoz-bottom-bar 6.3.0 → 6.3.1

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.
@@ -291,19 +291,24 @@ class CosmozBottomBar extends PolymerElement {
291
291
 
292
292
  _getElements() {
293
293
  const elements = FlattenedNodesObserver.getFlattenedNodes(this)
294
- .filter(this._isActionNode)
295
- .filter((element) => !element.hidden)
296
- .sort((a, b) => (a.dataset.index ?? 0) - (b.dataset.index ?? 0)),
297
- topPriorityAction = elements.reduce(
298
- (top, element) => {
299
- return parseInt(top.dataset.priority ?? 0, 10) >=
300
- parseInt(element.dataset.priority ?? 0, 10)
301
- ? top
302
- : element;
303
- },
304
- { dataset: { priority: '-1000' } },
305
- []
306
- );
294
+ .filter(this._isActionNode)
295
+ .filter((element) => !element.hidden)
296
+ .sort((a, b) => (a.dataset.index ?? 0) - (b.dataset.index ?? 0));
297
+
298
+ if (elements.length === 0) {
299
+ return elements;
300
+ }
301
+
302
+ const topPriorityAction = elements.reduce(
303
+ (top, element) => {
304
+ return parseInt(top.dataset.priority ?? 0, 10) >=
305
+ parseInt(element.dataset.priority ?? 0, 10)
306
+ ? top
307
+ : element;
308
+ },
309
+ { dataset: { priority: '-1000' } },
310
+ []
311
+ );
307
312
 
308
313
  return [
309
314
  topPriorityAction,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neovici/cosmoz-bottom-bar",
3
- "version": "6.3.0",
3
+ "version": "6.3.1",
4
4
  "description": "A responsive bottom-bar that can house buttons/actions and a menu for the buttons that won't fit the available width.",
5
5
  "keywords": [
6
6
  "polymer",