Fix for styling with a blank value

It's not usually valid, but can still be entered. I wasn't able to fix the positioning of the :after psuedo element without having a child text node. Maybe it's possible to add an empty child text node, but I didn't think it worth getting down to that level..
This commit is contained in:
David Cook
2024-02-01 11:31:14 +11:00
parent 133a9e6c7f
commit 079925bc9a

View File

@@ -43,6 +43,8 @@ export default class PopoutController extends Controller {
// Show, and apply value if it's a digit or word character
this.show(e);
this.first_input.value = e.key;
// Notify of change
this.first_input.dispatchEvent(new Event("input"));
}
}
@@ -57,6 +59,7 @@ export default class PopoutController extends Controller {
// Update button to represent any changes
this.buttonTarget.innerText = this.#displayValue();
this.buttonTarget.innerHTML ||= " "; // (with default space to help with styling)
this.buttonTarget.classList.toggle("changed", this.#isChanged());
this.dialogTarget.style.display = "none";