react-hook-core 0.1.9 → 0.1.10

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.
package/lib/state.js CHANGED
@@ -120,6 +120,14 @@ function buildState(e, state, ctrl, modelName, tloc) {
120
120
  return objSet;
121
121
  }
122
122
  else {
123
+ if (ctrl.tagName === 'SELECT') {
124
+ if (ctrl.value === '' || !ctrl.value) {
125
+ ctrl.removeAttribute('data-value');
126
+ }
127
+ else {
128
+ ctrl.setAttribute('data-value', 'data-value');
129
+ }
130
+ }
123
131
  var data = util_1.valueOf(ctrl, tloc, e.type);
124
132
  if (data.mustChange) {
125
133
  if (field.indexOf('.') < 0 && field.indexOf('[') < 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-hook-core",
3
- "version": "0.1.9",
3
+ "version": "0.1.10",
4
4
  "description": "react",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./src/index.ts",
package/src/state.ts CHANGED
@@ -100,6 +100,13 @@ export function buildState<S, K extends keyof S>(e: any, state: Readonly<S>, ctr
100
100
  objSet[modelName] = model;
101
101
  return objSet;
102
102
  } else {
103
+ if (ctrl.tagName === 'SELECT') {
104
+ if (ctrl.value === '' || !ctrl.value) {
105
+ ctrl.removeAttribute('data-value');
106
+ } else {
107
+ ctrl.setAttribute('data-value', 'data-value');
108
+ }
109
+ }
103
110
  const data = valueOf(ctrl, tloc, e.type);
104
111
  if (data.mustChange) {
105
112
  if (field.indexOf('.') < 0 && field.indexOf('[') < 0) {