@nr1e/qwik-ui 2.0.7 → 2.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -16,6 +16,8 @@ const TextField = qwik.component$((props) => {
16
16
  }
17
17
  }
18
18
  const touched = qwik.useSignal(false);
19
+ const originalTriggerResetValue = props.triggerReset?.value;
20
+ const originalTriggerValidationValue = props.triggerValidation?.value;
19
21
  qwik.useTask$(({ track }) => {
20
22
  if (props.error && typeof props.error !== "string") {
21
23
  track(() => error.value);
@@ -67,9 +69,11 @@ const TextField = qwik.component$((props) => {
67
69
  qwik.useTask$(async ({ track }) => {
68
70
  if (props.triggerReset) {
69
71
  track(() => props.triggerReset?.value);
70
- value.value = originalValue;
71
- error.value = void 0;
72
- touched.value = false;
72
+ if (originalTriggerResetValue !== props.triggerReset.value) {
73
+ value.value = originalValue;
74
+ error.value = void 0;
75
+ touched.value = false;
76
+ }
73
77
  }
74
78
  });
75
79
  const validate = qwik.$(async () => {
@@ -116,8 +120,10 @@ const TextField = qwik.component$((props) => {
116
120
  qwik.useTask$(async ({ track }) => {
117
121
  if (props.triggerValidation) {
118
122
  track(() => props.triggerValidation?.value);
119
- touched.value = true;
120
- await validate();
123
+ if (props.triggerValidation.value !== originalTriggerValidationValue) {
124
+ touched.value = true;
125
+ await validate();
126
+ }
121
127
  }
122
128
  });
123
129
  return /* @__PURE__ */ jsxRuntime.jsxs("div", {
@@ -14,6 +14,8 @@ const TextField = component$((props) => {
14
14
  }
15
15
  }
16
16
  const touched = useSignal(false);
17
+ const originalTriggerResetValue = props.triggerReset?.value;
18
+ const originalTriggerValidationValue = props.triggerValidation?.value;
17
19
  useTask$(({ track }) => {
18
20
  if (props.error && typeof props.error !== "string") {
19
21
  track(() => error.value);
@@ -65,9 +67,11 @@ const TextField = component$((props) => {
65
67
  useTask$(async ({ track }) => {
66
68
  if (props.triggerReset) {
67
69
  track(() => props.triggerReset?.value);
68
- value.value = originalValue;
69
- error.value = void 0;
70
- touched.value = false;
70
+ if (originalTriggerResetValue !== props.triggerReset.value) {
71
+ value.value = originalValue;
72
+ error.value = void 0;
73
+ touched.value = false;
74
+ }
71
75
  }
72
76
  });
73
77
  const validate = $(async () => {
@@ -114,8 +118,10 @@ const TextField = component$((props) => {
114
118
  useTask$(async ({ track }) => {
115
119
  if (props.triggerValidation) {
116
120
  track(() => props.triggerValidation?.value);
117
- touched.value = true;
118
- await validate();
121
+ if (props.triggerValidation.value !== originalTriggerValidationValue) {
122
+ touched.value = true;
123
+ await validate();
124
+ }
119
125
  }
120
126
  });
121
127
  return /* @__PURE__ */ jsxs("div", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nr1e/qwik-ui",
3
- "version": "2.0.7",
3
+ "version": "2.0.8",
4
4
  "description": "NR1E Qwik UI Library",
5
5
  "author": "NR1E, Inc.",
6
6
  "publishConfig": {