react-input-emoji 5.1.0 → 5.1.1
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/README.md +2 -1
- package/dist/index.es.js +6 -6
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
@@ -46,7 +46,7 @@ export default function Example() {
|
|
46
46
|
## Props
|
47
47
|
|
48
48
|
| Prop | Type | Default | Description |
|
49
|
-
|
49
|
+
| -------------- | -------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------ |
|
50
50
|
| `value` | string | "" | The input value. |
|
51
51
|
| `onChange` | function | - | This function is called when the value of the input changes. The first argument is the current value. |
|
52
52
|
| `onResize` | function | - | This function is called when the width or the height of the input changes. The first argument is the current size value. |
|
@@ -62,6 +62,7 @@ export default function Example() {
|
|
62
62
|
| `borderColor` | string | "#EAEAEA" | The border color of the input container. |
|
63
63
|
| `fontSize` | number | 15 | The font size of the placeholder and input container. |
|
64
64
|
| `fontFamily` | string | "sans-serif" | The font family of the placeholder and input container. |
|
65
|
+
| `shouldReturn` | boolean | - | Allows the user to use the `Shift + Enter` or `Ctrl + Enter` keyboard shortcut to create a new line. |
|
65
66
|
|
66
67
|
## License
|
67
68
|
|
package/dist/index.es.js
CHANGED
@@ -764,7 +764,7 @@ function removeHtmlExceptBr(inputDiv) {
|
|
764
764
|
|
765
765
|
var stripped = temp.replace(/<[^>]+>/g, ''); // strip all html tags
|
766
766
|
|
767
|
-
var _final = stripped.replace(/\[BR\]/gi, '
|
767
|
+
var _final = stripped.replace(/\[BR\]/gi, '</br>'); // replace placeholders with <br>
|
768
768
|
|
769
769
|
|
770
770
|
return _final;
|
@@ -1046,13 +1046,13 @@ var TextInput = function TextInput(_ref, ref) {
|
|
1046
1046
|
|
1047
1047
|
function handleKeyDown(event) {
|
1048
1048
|
if (event.key === "Enter" && (event.shiftKey === true || event.ctrlKey === true) && props.shouldReturn) {
|
1049
|
-
|
1050
|
-
|
1051
|
-
|
1049
|
+
event.preventDefault();
|
1050
|
+
|
1051
|
+
if (textInputRef.current) {
|
1052
|
+
textInputRef.current.innerHTML = "".concat(textInputRef.current.innerHTML, "</br></br>");
|
1052
1053
|
moveCaretToEnd(textInputRef);
|
1054
|
+
return;
|
1053
1055
|
}
|
1054
|
-
|
1055
|
-
return;
|
1056
1056
|
}
|
1057
1057
|
|
1058
1058
|
if (event.key === "Enter") {
|