Skip to content

Commit

Permalink
fix issue #11 and bumped to prerelease version
Browse files Browse the repository at this point in the history
  • Loading branch information
bohnacker committed Dec 2, 2021
1 parent ca23a1a commit 11ccec4
Show file tree
Hide file tree
Showing 6 changed files with 2,971 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,7 @@

function keydownHandler(ev) {
// prevent submitting if the number spinner is inside a form element
if (ev.key == "Enter") {
if (ev.key == "Enter" && (ev.target == dragElement || ev.target == editElement)) {
ev.preventDefault();
}

Expand Down
2 changes: 1 addition & 1 deletion dist/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,7 @@ function instance($$self, $$props, $$invalidate) {

function keydownHandler(ev) {
// prevent submitting if the number spinner is inside a form element
if (ev.key == "Enter") {
if (ev.key == "Enter" && (ev.target == dragElement || ev.target == editElement)) {
ev.preventDefault();
}

Expand Down
2,967 changes: 2,966 additions & 1 deletion example/public/build/bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion example/public/build/bundle.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"src",
"dist"
],
"version": "0.7.9",
"version": "0.7.10-rc1",
"repository": {
"type": "git",
"url": "git+https://github.com/bohnacker/svelte-number-spinner.git"
Expand Down
2 changes: 1 addition & 1 deletion src/NumberSpinner.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@
function keydownHandler(ev) {
// prevent submitting if the number spinner is inside a form element
if (ev.key == "Enter") {
if (ev.key == "Enter" && (ev.target == dragElement || ev.target == editElement)) {
ev.preventDefault();
}
Expand Down

0 comments on commit 11ccec4

Please sign in to comment.