react-edit-text
Advanced tools
Comparing version 4.0.1 to 4.0.2
@@ -0,1 +1,8 @@ | ||
## [4.0.2](https://github.com/bymi15/react-edit-text/compare/v4.0.1...v4.0.2) (2021-04-03) | ||
### Bug Fixes | ||
* setSelectionRange causing bugs for input types that are not text ([777fba9](https://github.com/bymi15/react-edit-text/commit/777fba9f5d401d4374b653e6ae4f7f39b2c2adca)) | ||
## [4.0.1](https://github.com/bymi15/react-edit-text/compare/v4.0.0...v4.0.1) (2021-03-09) | ||
@@ -2,0 +9,0 @@ |
@@ -1166,2 +1166,8 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } | ||
_this.handleFocus = function (e) { | ||
if (_this.props.type === 'text') { | ||
e.currentTarget.setSelectionRange(e.currentTarget.value.length, e.currentTarget.value.length); | ||
} | ||
}; | ||
_this.state = { | ||
@@ -1229,5 +1235,3 @@ previousValue: props.defaultValue || '', | ||
autoFocus: true, | ||
onFocus: function onFocus(e) { | ||
return e.currentTarget.setSelectionRange(e.currentTarget.value.length, e.currentTarget.value.length); | ||
} | ||
onFocus: this.handleFocus | ||
}); | ||
@@ -1248,5 +1252,3 @@ } else { | ||
autoFocus: true, | ||
onFocus: function onFocus(e) { | ||
return e.currentTarget.setSelectionRange(e.currentTarget.value.length, e.currentTarget.value.length); | ||
} | ||
onFocus: this.handleFocus | ||
}); | ||
@@ -1253,0 +1255,0 @@ } |
@@ -1164,2 +1164,8 @@ import React from 'react'; | ||
_this.handleFocus = function (e) { | ||
if (_this.props.type === 'text') { | ||
e.currentTarget.setSelectionRange(e.currentTarget.value.length, e.currentTarget.value.length); | ||
} | ||
}; | ||
_this.state = { | ||
@@ -1227,5 +1233,3 @@ previousValue: props.defaultValue || '', | ||
autoFocus: true, | ||
onFocus: function onFocus(e) { | ||
return e.currentTarget.setSelectionRange(e.currentTarget.value.length, e.currentTarget.value.length); | ||
} | ||
onFocus: this.handleFocus | ||
}); | ||
@@ -1246,5 +1250,3 @@ } else { | ||
autoFocus: true, | ||
onFocus: function onFocus(e) { | ||
return e.currentTarget.setSelectionRange(e.currentTarget.value.length, e.currentTarget.value.length); | ||
} | ||
onFocus: this.handleFocus | ||
}); | ||
@@ -1251,0 +1253,0 @@ } |
{ | ||
"name": "react-edit-text", | ||
"version": "4.0.1", | ||
"version": "4.0.2", | ||
"description": "Simple editable text component for React", | ||
@@ -5,0 +5,0 @@ "author": "Brian Min <bymi15@yahoo.com> (https://github.com/bymi15)", |
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
2750
307208