Posted 17 April 2025, 2:58 am EST
Hi Jonathan,
Since the API for Validate button is not public, I would suggest adding an event handler (say keydown(shortcut key) or input change) as per your use case and click the Validate button present in the DOM.
Sample Code:
document.addEventListener("keydown", (e) => {
if (e.key === "Enter") {
const designerHost = document.querySelector("#designer-host");
if(!designerHost) {
console.warn("Designer host not found.");
return;
}
const buttons = designerHost.querySelectorAll(".ed-dataset-dialog .gc-modal__footer button");
const validateButton = Array.from(buttons).find((button) => {
const span = button.querySelector("span");
return span && span.textContent.trim() === "Validate";
});
if (validateButton) {
console.log("Clicking Validate button:", validateButton);
validateButton.click();
} else {
console.warn("No Validate button found.");
}
}
});
I hope this helps!