glib-web 5.0.9 → 5.0.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.
@@ -7,7 +7,7 @@
7
7
  :suffix="spec.rightText" :min="spec.min" :max="spec.max" :autofocus="spec.autoFocus || false" validate-on="blur"
8
8
  :variant="variant" persistent-placeholder :clearable="spec.clearable" :rounded="spec.rounded"
9
9
  :autocomplete="spec.autocomplete" @click:appendInner="onRightIconClick" @input="onChange"
10
- @keyup="$onTyping({ duration: 2000 })" @wheel.prevent />
10
+ @keyup="$onTyping({ duration: 2000 })" @wheel="onWheel" />
11
11
  </div>
12
12
  </template>
13
13
 
@@ -131,6 +131,17 @@ export default {
131
131
  action_focus() {
132
132
  this.$refs.field.focus();
133
133
  },
134
+ onWheel() {
135
+ // Only number inputs change their value on wheel scroll, and only while
136
+ // focused. Blur the focused number input so the value stays put while the
137
+ // wheel event still bubbles up and scrolls the page. All other field types
138
+ // (and unfocused number fields) are left untouched so the page can scroll.
139
+ if (this.config.type !== "number") return;
140
+ const input = this.$refs.field?.$el?.querySelector("input");
141
+ if (input && document.activeElement === input) {
142
+ input.blur();
143
+ }
144
+ },
134
145
  onChange: eventFiltering.debounce(function () {
135
146
  this.$executeOnChange();
136
147
  }, 300),
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "glib-web",
4
- "version": "5.0.9",
4
+ "version": "5.0.10",
5
5
  "description": "",
6
6
  "main": "index.js",
7
7
  "scripts": {