Skip to content

Commit

Permalink
easy mode setting validation check working
Browse files Browse the repository at this point in the history
  • Loading branch information
syrk4web committed Aug 8, 2024
1 parent b613414 commit 0e02081
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions src/ui/client/dashboard/components/Form/Easy.vue
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,6 @@ const data = reactive({
isReqErr: false,
settingErr: "",
stepErr: "",
checkValidity: computed(() => {
setValidity();
}),
});
watch(
Expand Down Expand Up @@ -139,6 +136,18 @@ function setup() {
setValidity();
}
/**
* @name listenToValidate
* @description Setup the needed data for the component to work properly.
* @returns {void}
*/
function listenToValidate(e) {
setTimeout(() => {
if (!e.target.closest('[data-is="form"]')) return;
setValidity();
}, 50);
}
const buttonSave = {
id: `easy-mode-${uuidv4()}`,
text: "action_save",
Expand Down Expand Up @@ -166,10 +175,12 @@ onMounted(() => {
setup();
// I want updatInp to access event, data.base and the container attribut
easyForm.useListenTempFields();
window.addEventListener("input", listenToValidate);
});
onUnmounted(() => {
easyForm.useUnlistenTempFields();
window.removeEventListener("input", listenToValidate);
});
</script>

Expand Down

0 comments on commit 0e02081

Please sign in to comment.