From 0cc8a44c3d27933bb581a2c258b2c238e8009904 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Chalifour?= Date: Thu, 3 Sep 2020 15:10:07 +0200 Subject: [PATCH] feat(js): add magnifier glass as label --- packages/autocomplete-js/src/autocomplete.ts | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/packages/autocomplete-js/src/autocomplete.ts b/packages/autocomplete-js/src/autocomplete.ts index a12b4c0ad..140663ce7 100644 --- a/packages/autocomplete-js/src/autocomplete.ts +++ b/packages/autocomplete-js/src/autocomplete.ts @@ -110,8 +110,20 @@ export function autocomplete({ const labelProps = autocomplete.getLabelProps(); setProperties(label, labelProps); - // @TODO have a magnifier glass - label.textContent = 'Search items'; + label.innerHTML = ` + +`; label.classList.add('aa-Label'); inputWrapper.classList.add('aa-InputWrapper'); @@ -207,7 +219,7 @@ export function autocomplete({ renderDropdown({ root: dropdown, sections, state }); } - form.appendChild(label); + inputWrapper.appendChild(label); if (props.enableCompletion) { inputWrapper.appendChild(completion); }