From b79bb0e9d84082295e68096c54cca685c2d18e72 Mon Sep 17 00:00:00 2001 From: Paul Schreiber Date: Fri, 9 Sep 2022 16:25:11 -0400 Subject: [PATCH 1/3] make resest button a button; add aria label --- src/SearchControl.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/SearchControl.ts b/src/SearchControl.ts index ea30ce73e..643c0824d 100644 --- a/src/SearchControl.ts +++ b/src/SearchControl.ts @@ -36,6 +36,7 @@ const defaultOptions: Omit = { retainZoomLevel: false, animateZoom: true, searchLabel: 'Enter address', + clearSearchLabel: 'Clear search', notFoundMessage: '', messageHideDelay: 3000, zoomLevel: 18, @@ -194,12 +195,12 @@ const Control: SearchControl = { L.DomEvent.disableClickPropagation(this.button); this.resetButton = createElement( - 'a', + 'button', this.classNames.resetButton, this.searchElement.form, { text: '×', - href: '#', + 'aria-label': this.options.clearSearchLabel, onClick: () => this.clearResults(null, true), }, ); From f133451d9fa81bab3bef709d50567b68ee5aa1fb Mon Sep 17 00:00:00 2001 From: Stephan Meijer Date: Mon, 3 Oct 2022 22:41:52 +0200 Subject: [PATCH 2/3] fix: change selectors to match change of element type --- assets/css/leaflet.css | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/assets/css/leaflet.css b/assets/css/leaflet.css index 08aa2561b..a605e07f7 100644 --- a/assets/css/leaflet.css +++ b/assets/css/leaflet.css @@ -216,7 +216,7 @@ font-style: italic; } -.leaflet-control-geosearch a.reset { +.leaflet-control-geosearch button.reset { color: black; font-weight: bold; position: absolute; @@ -231,10 +231,10 @@ border-radius: 0 4px 4px 0; } -.leaflet-touch .leaflet-control-geosearch a.reset { +.leaflet-touch .leaflet-control-geosearch button.reset { line-height: 30px; } -.leaflet-control-geosearch a.reset:hover { +.leaflet-control-geosearch button.reset:hover { background: #f5f5f5; } From 67960fb170a03e5204a6b59e5ebff7d59ad9f172 Mon Sep 17 00:00:00 2001 From: Stephan Meijer Date: Mon, 3 Oct 2022 22:43:52 +0200 Subject: [PATCH 3/3] fix: add type def for new property --- src/SearchControl.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/SearchControl.ts b/src/SearchControl.ts index 643c0824d..354ec100c 100644 --- a/src/SearchControl.ts +++ b/src/SearchControl.ts @@ -84,6 +84,7 @@ interface SearchControlProps { resultFormat(args: { result: SearchResult }): string; searchLabel: string; + clearSearchLabel: string; notFoundMessage: string; messageHideDelay: number;