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:
+1
-1
@@ -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 =
|
||||
|
||||
Reference in New Issue
Block a user