File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -57,6 +57,7 @@ class GEAutocomplete extends HTMLElement {
5757 'debounce' ,
5858 'lang' ,
5959 'size' ,
60+ 'value' ,
6061 'layers' ,
6162 'sources' ,
6263 'boundary.country' ,
@@ -73,6 +74,16 @@ class GEAutocomplete extends HTMLElement {
7374 ]
7475 }
7576
77+ // getter & setter for the value attribute as _if_ any attribute is programatically
78+ // changed then it’s this one
79+ get value ( ) {
80+ return this . getAttribute ( 'value' ) ?. trim ( )
81+ }
82+
83+ set value ( text ) {
84+ this . setAttribute ( 'value' , text )
85+ }
86+
7687 // props returns element attributes converted to props to be passed on
7788 // to the react component
7889 get props ( ) {
@@ -81,6 +92,7 @@ class GEAutocomplete extends HTMLElement {
8192 placeholder : this . getAttribute ( 'placeholder' ) ,
8293 autoFocus : this . getAttribute ( 'autofocus' ) !== null ,
8394 debounce : parseInt ( this . getAttribute ( 'debounce' ) ) ,
95+ value : this . value ,
8496 params : compact ( {
8597 lang : this . getAttribute ( 'lang' ) ,
8698 size : parseInt ( this . getAttribute ( 'size' ) ) ,
You can’t perform that action at this time.
0 commit comments