From 15a6efc91650321372310fd0787fd39fca7c59ff Mon Sep 17 00:00:00 2001 From: Junior Lopes Date: Thu, 7 Nov 2024 14:44:39 +0100 Subject: [PATCH 1/4] =?UTF-8?q?p=C3=A5b=C3=B6rjat=20en=20l=C3=B6sning?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../filter-tag/filter-tag-group.component.html | 4 ++-- .../filter-tag/filter-tag-group.component.ts | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/projects/komponentkartan/src/lib/controls/filter-tag/filter-tag-group.component.html b/projects/komponentkartan/src/lib/controls/filter-tag/filter-tag-group.component.html index fa4a548d1..f5b78361f 100644 --- a/projects/komponentkartan/src/lib/controls/filter-tag/filter-tag-group.component.html +++ b/projects/komponentkartan/src/lib/controls/filter-tag/filter-tag-group.component.html @@ -1,3 +1,3 @@ -
+
-
\ No newline at end of file +
diff --git a/projects/komponentkartan/src/lib/controls/filter-tag/filter-tag-group.component.ts b/projects/komponentkartan/src/lib/controls/filter-tag/filter-tag-group.component.ts index c281866c2..2c8b65b5d 100644 --- a/projects/komponentkartan/src/lib/controls/filter-tag/filter-tag-group.component.ts +++ b/projects/komponentkartan/src/lib/controls/filter-tag/filter-tag-group.component.ts @@ -35,6 +35,22 @@ export class FilterTagGroupComponent implements AfterContentInit, OnDestroy { this.ngUnsubscribe.complete(); } + onKeydown(event: any) { + if (event.key === 'Tab') { + const filterTagGroup = event.target.closest('vgr-filter-tag-group'); + event.preventDefault(); + var nextEl = this.findNextTabStop(filterTagGroup); + nextEl.focus(); + } + } + + findNextTabStop(el) { + var universe = document.querySelectorAll('input, button, select, textarea, a[href]'); + var list = Array.prototype.filter.call(universe, function(item) {return item.tabIndex >= "0"}); + var index = list.indexOf(el); + return list[index + 1] || list[0]; + } + setFilterTagTabFocusability() { this.filterTags.forEach((x) => { x.makeTabFocusable(true); From 1b6b8269560dced68a0dc434f6f23dee3fc7b6cb Mon Sep 17 00:00:00 2001 From: Junior Lopes Date: Fri, 8 Nov 2024 14:38:31 +0100 Subject: [PATCH 2/4] wip --- .../filter-tag/filter-tag-group.component.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/projects/komponentkartan/src/lib/controls/filter-tag/filter-tag-group.component.ts b/projects/komponentkartan/src/lib/controls/filter-tag/filter-tag-group.component.ts index 2c8b65b5d..8ff58c2bb 100644 --- a/projects/komponentkartan/src/lib/controls/filter-tag/filter-tag-group.component.ts +++ b/projects/komponentkartan/src/lib/controls/filter-tag/filter-tag-group.component.ts @@ -39,22 +39,24 @@ export class FilterTagGroupComponent implements AfterContentInit, OnDestroy { if (event.key === 'Tab') { const filterTagGroup = event.target.closest('vgr-filter-tag-group'); event.preventDefault(); - var nextEl = this.findNextTabStop(filterTagGroup); + var nextEl = this.findNextTabStop(document.activeElement); nextEl.focus(); } } findNextTabStop(el) { - var universe = document.querySelectorAll('input, button, select, textarea, a[href]'); + var universe = document.querySelectorAll('[tabindex]'); var list = Array.prototype.filter.call(universe, function(item) {return item.tabIndex >= "0"}); + console.log(list) var index = list.indexOf(el); return list[index + 1] || list[0]; } setFilterTagTabFocusability() { - this.filterTags.forEach((x) => { - x.makeTabFocusable(true); - }); + this.filterTags.get(0).makeTabFocusable(true); + // this.filterTags.forEach((x) => { + // x.makeTabFocusable(true); + // }); } setFilterTagFocus() { From 7585905e9e35dacf9b443be5876731996a7399f8 Mon Sep 17 00:00:00 2001 From: Junior Lopes Date: Tue, 12 Nov 2024 11:26:16 +0100 Subject: [PATCH 3/4] gjort en fix --- .../filter-tag-group.component.html | 2 +- .../filter-tag/filter-tag-group.component.ts | 23 +++---------------- 2 files changed, 4 insertions(+), 21 deletions(-) diff --git a/projects/komponentkartan/src/lib/controls/filter-tag/filter-tag-group.component.html b/projects/komponentkartan/src/lib/controls/filter-tag/filter-tag-group.component.html index f5b78361f..48f210d4a 100644 --- a/projects/komponentkartan/src/lib/controls/filter-tag/filter-tag-group.component.html +++ b/projects/komponentkartan/src/lib/controls/filter-tag/filter-tag-group.component.html @@ -1,3 +1,3 @@ -
+
diff --git a/projects/komponentkartan/src/lib/controls/filter-tag/filter-tag-group.component.ts b/projects/komponentkartan/src/lib/controls/filter-tag/filter-tag-group.component.ts index 8ff58c2bb..ad75888de 100644 --- a/projects/komponentkartan/src/lib/controls/filter-tag/filter-tag-group.component.ts +++ b/projects/komponentkartan/src/lib/controls/filter-tag/filter-tag-group.component.ts @@ -35,28 +35,11 @@ export class FilterTagGroupComponent implements AfterContentInit, OnDestroy { this.ngUnsubscribe.complete(); } - onKeydown(event: any) { - if (event.key === 'Tab') { - const filterTagGroup = event.target.closest('vgr-filter-tag-group'); - event.preventDefault(); - var nextEl = this.findNextTabStop(document.activeElement); - nextEl.focus(); - } - } - - findNextTabStop(el) { - var universe = document.querySelectorAll('[tabindex]'); - var list = Array.prototype.filter.call(universe, function(item) {return item.tabIndex >= "0"}); - console.log(list) - var index = list.indexOf(el); - return list[index + 1] || list[0]; - } - setFilterTagTabFocusability() { + this.filterTags.forEach((x) => { + x.makeTabFocusable(false); + }); this.filterTags.get(0).makeTabFocusable(true); - // this.filterTags.forEach((x) => { - // x.makeTabFocusable(true); - // }); } setFilterTagFocus() { From 1272448ba2836d1084f64d68ad244f955eb945ff Mon Sep 17 00:00:00 2001 From: Junior Lopes Date: Thu, 14 Nov 2024 08:26:41 +0100 Subject: [PATCH 4/4] ny beta --- projects/komponentkartan/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/komponentkartan/package.json b/projects/komponentkartan/package.json index 44d053bfe..f1023c651 100644 --- a/projects/komponentkartan/package.json +++ b/projects/komponentkartan/package.json @@ -1,6 +1,6 @@ { "name": "vgr-komponentkartan", - "version": "12.0.3", + "version": "12.0.4-beta", "peerDependencies": { "@angular/cdk": ">=17.0.0", "@angular/common": ">=17.0.0",