@acusti/input-text
Advanced tools
Comparing version 1.7.0 to 1.7.1
@@ -93,8 +93,6 @@ import * as React from 'react'; | ||
onKeyDown(event); | ||
if (multiLine && | ||
submitOnEnter && | ||
if (submitOnEnter && | ||
event.key === 'Enter' && | ||
!event.shiftKey && | ||
!event.altKey && | ||
!event.ctrlKey) { | ||
// for multi-line inputs, shift/alt/ctrl-Enter should insert newlines | ||
(!multiLine || (!event.shiftKey && !event.altKey && !event.ctrlKey))) { | ||
event.preventDefault(); | ||
@@ -105,6 +103,4 @@ const form = event.currentTarget.closest('form'); | ||
} | ||
else { | ||
// if no form to submit, trigger input blur | ||
event.currentTarget.blur(); | ||
} | ||
// always blur input on Enter when submitOnEnter is true | ||
event.currentTarget.blur(); | ||
} | ||
@@ -111,0 +107,0 @@ else if (doubleClickToEdit && inputRef.current) { |
{ | ||
"name": "@acusti/input-text", | ||
"version": "1.7.0", | ||
"version": "1.7.1", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "sideEffects": false, |
@@ -99,2 +99,4 @@ # @acusti/input-text | ||
Note: the `InputElement` type referenced in the event handlers above is a union of `HTMLInputElement` and `HTMLTextAreaElement` and is available as an export (`import type { InputElement } from '@acusti/input-text';`). | ||
Note: the `InputElement` type referenced in the event handlers above is a | ||
union of `HTMLInputElement` and `HTMLTextAreaElement` and is available as | ||
an export (`import type { InputElement } from '@acusti/input-text';`). |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
38739
102
518