Resetting value of auro-input does not reset label text
ethanwmiller opened this issue · comments
Please verify the version of auro-input you have installed
2.14.1
Please describe the bug
Create an auro-input
component with a specific id and a label text slot. Create a button with a click handler that sets the value of the input to undefined
. Type something in the input, then click the button to reset the value. The value is reset correctly, but the label text stays stuck in the "active" position.
Example component code:
<auro-input
id="comments-input"
bordered
>
<span slot="label">{"Comments"}</span>
</auro-input>
Example of resetting the element's value:
const elem = document.querySelector('#comments-input');
elem.value = undefined;
Two screenshots: one is of the label text in the initial state, the second is of the label text stuck in the "active" state after the value got set to undefined with the code above.
![Screen Shot 2023-09-12 at 2 23 16 PM](https://private-user-images.githubusercontent.com/126627409/267749301-bb7f9d25-abc9-4b89-bec2-c61c637527bc.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjA2NjkzNDQsIm5iZiI6MTcyMDY2OTA0NCwicGF0aCI6Ii8xMjY2Mjc0MDkvMjY3NzQ5MzAxLWJiN2Y5ZDI1LWFiYzktNGI4OS1iZWMyLWM2MWM2Mzc1MjdiYy5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzExJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcxMVQwMzM3MjRaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0zN2Y2OWUzNGE5ZjQzY2FkNGM5MjliYjNmNGFjZjcyOTgyMTI0YzI5MzliNWExMzA2NDNkNWMxMjA1MmRiMmYzJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.cagc4uZQSY7VeGdhzbbZlMsdvi2wRyTeirGrYyEidKE)
Reproducing the error on the docsite
This issue cannot be reproduced on the Auro docsite
Expected behavior
When the value
of the input is reset to undefined
, the label text should reset to its initial position.
What browsers are you seeing the problem on?
Chrome
Additional context
NOTE: the docsite for this feature is broken; the example buttons for resetting the input value do not work (on my browser at least). https://auro.alaskaair.com/components/auro/input