From 079925bc9a931e88f98be87dfcd205d94e99515c Mon Sep 17 00:00:00 2001 From: David Cook Date: Thu, 1 Feb 2024 11:31:14 +1100 Subject: [PATCH] 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.. --- app/webpacker/controllers/popout_controller.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/webpacker/controllers/popout_controller.js b/app/webpacker/controllers/popout_controller.js index 0545e2d3c9..287ed98771 100644 --- a/app/webpacker/controllers/popout_controller.js +++ b/app/webpacker/controllers/popout_controller.js @@ -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";