react-input-emoji 5.4.1 → 5.5.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/dist/index.es.js CHANGED
@@ -4899,7 +4899,12 @@ function InputEmoji(props, ref) {
4899
4899
  textInputRef.current.html = replaceAllTextEmojis(nextValue);
4900
4900
  sanitizedTextRef.current = nextValue;
4901
4901
  }, [sanitizedTextRef]);
4902
- var setValue = useCallback(function (value) {
4902
+ var setValue = useCallback(
4903
+ /**
4904
+ *
4905
+ * @param {string} value
4906
+ */
4907
+ function (value) {
4903
4908
  updateHTML(value);
4904
4909
  }, [updateHTML]);
4905
4910
  var emitChange = useEmit(textInputRef, onResize, onChange);
@@ -4913,10 +4918,10 @@ function InputEmoji(props, ref) {
4913
4918
  if (sanitizedTextRef.current !== value) {
4914
4919
  setValue(value);
4915
4920
  }
4916
- }, [sanitizedTextRef, setValue, value]);
4917
- useEffect(function () {
4918
- updateHTML();
4919
- }, [updateHTML]);
4921
+ }, [sanitizedTextRef, setValue, value]); // useEffect(() => {
4922
+ // updateHTML();
4923
+ // }, [updateHTML]);
4924
+
4920
4925
  useEffect(function () {
4921
4926
  /**
4922
4927
  * Handle keydown event
@@ -4997,7 +5002,10 @@ function InputEmoji(props, ref) {
4997
5002
 
4998
5003
  function handleTextInputChange(html) {
4999
5004
  sanitize(html);
5000
- emitChange(sanitizedTextRef.current);
5005
+
5006
+ if (value !== sanitizedTextRef.current) {
5007
+ emitChange(sanitizedTextRef.current);
5008
+ }
5001
5009
  }
5002
5010
  /**
5003
5011
  *