fix: WCEnd editor modal pre-loads correct colour and errno value

- Default colour now checks dataset.exitError instead of tagName === 'WC-END',
  so success (exit 0) END blocks default to blue, error END blocks to red
- _selectByCode now also sets the HTML value attribute via setAttribute(),
  ensuring cloneNode(true) preserves the formatted display value
- Add 4 regression tests for colour defaults, attribute sync, and clone value
This commit is contained in:
2026-06-23 00:52:56 +02:00
parent 68da5592ef
commit 3657a22125
3 changed files with 61 additions and 3 deletions
+1 -1
View File
@@ -382,7 +382,7 @@ function showBlockEditor(block) {
body.innerHTML = "";
/* Colour picker row; error blocks default to red, others to blue */
const defaultColor = block.classList.contains("error-path") || block.tagName === "WC-END" ? "#ef5350" : "#4a90d9";
const defaultColor = block.classList.contains("error-path") || block.dataset.exitError ? "#ef5350" : "#4a90d9";
const colorRow = document.createElement("div");
colorRow.className = "block-editor-color-row";
colorRow.innerHTML =