From 3ebd15b67e4ab05cb280d4f363a966e4a4fc09eb Mon Sep 17 00:00:00 2001 From: Mike Masey Date: Sun, 23 Oct 2022 15:37:43 +0100 Subject: [PATCH] fix: move list view selection options to after list in focus order --- .../components/umbstickybar.directive.js | 8 +- .../src/less/listview.less | 10 ++ .../propertyeditors/listview/listview.html | 153 +++++++----------- 3 files changed, 77 insertions(+), 94 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/umbstickybar.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/umbstickybar.directive.js index de6555a05a..28b2647184 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/umbstickybar.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/umbstickybar.directive.js @@ -30,16 +30,18 @@ Use this directive make an element sticky and follow the page when scrolling. `u /** Toggle `umb-sticky-bar--active` class on the sticky-bar element **/ - const setClass = (addClass, current) => current.classList.toggle('umb-sticky-bar--active', addClass); + const setClass = (addClass, current) => current.classList.toggle('umb-sticky-bar--active', addClass); /** Inserts two elements in the umbStickyBar parent element These are used by the IntersectionObserve to calculate scroll position **/ const addSentinel = current => { - const sentinel = document.createElement('div'); - sentinel.classList.add('umb-sticky-sentinel', '-top'); + if (current.parentElement.querySelector(".umb-sticky-sentinel") === null) { + const sentinel = document.createElement("div"); + sentinel.classList.add("umb-sticky-sentinel", "-top"); current.parentElement.prepend(sentinel); + } }; /** diff --git a/src/Umbraco.Web.UI.Client/src/less/listview.less b/src/Umbraco.Web.UI.Client/src/less/listview.less index 9321577c15..736fc99f85 100644 --- a/src/Umbraco.Web.UI.Client/src/less/listview.less +++ b/src/Umbraco.Web.UI.Client/src/less/listview.less @@ -219,6 +219,16 @@ display: none !important } +/* Sticky sub header with correct focus ordering */ +.umb-listview .umb-listview__container { + display: flex; + flex-direction: column; +} + +.umb-listview .umb-listview__container .umb-editor-sub-header { + order: -1; +} + /* ---------- LAYOUTS ---------- */ .list-view-layout { diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/listview.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/listview.html index ab9464d6b2..b7462696b6 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/listview.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/listview.html @@ -4,9 +4,9 @@ -
+
- + @@ -88,30 +88,12 @@ - - - - - - - {{ selectedItemsCount() }} of {{ listViewResultSet.items.length }} selected - - - - - - + - + - - - - - - - - - - - - - - - - - - - - @@ -216,6 +129,64 @@
{{viewLoadedError}}
+ + + + + + + + + + + {{ selectedItemsCount() }} + of {{ + listViewResultSet.items.length }} + selected + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +