I’m trying to do separate things for “focus” and “click” events for my input box, i.e. sp-textfield element.
Example:
<sp-textfield quiet type="number" id="inputHEIGHT" ></sp-textfield>
The “focus” JS is:
document.getElementById("inputHEIGHT").addEventListener("focus", () => {console.log(document.getElementById("inputHEIGHT").value)})
and this properly logs the input field’s value.
However the “click” JS is:
document.getElementById("inputHEIGHT").addEventListener("click", () => {console.log(document.getElementById("inputHEIGHT").value)})
and it logs nothing. In other words, clicking on the input box doesn’t trigger the click event that I can tell.
Am I doing something wrong or does the “click” event not work with sp-textfield elements?