ublo-lib 1.0.28 → 1.0.31

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.
@@ -81,7 +81,7 @@ const CustomContactForm = ({
81
81
  };
82
82
 
83
83
  const resetForm = () => {
84
- presets.setter?.(undefined);
84
+ presets?.setter?.(undefined);
85
85
  setData(getInitialFormState(fields));
86
86
  };
87
87
 
@@ -101,7 +101,7 @@ const CustomContactForm = ({
101
101
  }
102
102
  }, [ready, settings, site]);
103
103
  React.useEffect(() => {
104
- setData(getInitialFormState(fields, presets.values));
104
+ setData(getInitialFormState(fields, presets?.values));
105
105
  }, [fields, presets?.values]);
106
106
  const classes = classnames(styles.root, {
107
107
  [className]: className
@@ -198,9 +198,10 @@ const Inner = ({
198
198
  if (subjects?.length === 1) {
199
199
  const value = subjects?.[0]?.value || "";
200
200
  onChange(value);
201
+ setOptions(subjects);
202
+ } else {
203
+ setOptions(["", ...subjects]);
201
204
  }
202
-
203
- setOptions(subjects);
204
205
  };
205
206
 
206
207
  getSubjects();
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- import { useEffect, useState } from "react";
2
+ import { useEffect, useState, useMemo } from "react";
3
3
  import classnames from "classnames";
4
4
  import { useUbloContext } from "ublo/with-ublo";
5
5
  import { fetchRandomInstructors } from "./fetcher";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ublo-lib",
3
- "version": "1.0.28",
3
+ "version": "1.0.31",
4
4
  "peerDependencies": {
5
5
  "dt-design-system": "^2.0.0",
6
6
  "next": "^12.0.0",