@sproutsocial/racine 11.6.1-input-beta.2 → 11.6.1-input-beta.3
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/__flow__/Input/index.js +6 -2
- package/commonjs/Input/index.js +3 -2
- package/lib/Input/index.js +3 -2
- package/package.json +1 -1
package/__flow__/Input/index.js
CHANGED
|
@@ -175,8 +175,12 @@ class Input extends React.Component<TypeProps, TypeState> {
|
|
|
175
175
|
handleClear = (e: SyntheticEvent<HTMLButtonElement>) => {
|
|
176
176
|
const input = this.inputRef.current;
|
|
177
177
|
if (input) {
|
|
178
|
-
// Clear the value via
|
|
179
|
-
|
|
178
|
+
// Clear the value via the input prototype, then dispatch an input event in order to trigger handleChange
|
|
179
|
+
const nativeInputValueSetter = Object.getOwnPropertyDescriptor(
|
|
180
|
+
window.HTMLInputElement.prototype,
|
|
181
|
+
"value"
|
|
182
|
+
).set;
|
|
183
|
+
nativeInputValueSetter.call(input, "");
|
|
180
184
|
const inputEvent = new Event("input", { bubbles: true });
|
|
181
185
|
input.dispatchEvent(inputEvent);
|
|
182
186
|
|
package/commonjs/Input/index.js
CHANGED
|
@@ -101,8 +101,9 @@ var Input = /*#__PURE__*/function (_React$Component) {
|
|
|
101
101
|
var input = _this.inputRef.current;
|
|
102
102
|
|
|
103
103
|
if (input) {
|
|
104
|
-
// Clear the value via
|
|
105
|
-
|
|
104
|
+
// Clear the value via the input prototype, then dispatch an input event in order to trigger handleChange
|
|
105
|
+
var nativeInputValueSetter = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, "value").set;
|
|
106
|
+
nativeInputValueSetter.call(input, "");
|
|
106
107
|
var inputEvent = new Event("input", {
|
|
107
108
|
bubbles: true
|
|
108
109
|
});
|
package/lib/Input/index.js
CHANGED
|
@@ -84,8 +84,9 @@ var Input = /*#__PURE__*/function (_React$Component) {
|
|
|
84
84
|
var input = _this.inputRef.current;
|
|
85
85
|
|
|
86
86
|
if (input) {
|
|
87
|
-
// Clear the value via
|
|
88
|
-
|
|
87
|
+
// Clear the value via the input prototype, then dispatch an input event in order to trigger handleChange
|
|
88
|
+
var nativeInputValueSetter = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, "value").set;
|
|
89
|
+
nativeInputValueSetter.call(input, "");
|
|
89
90
|
var inputEvent = new Event("input", {
|
|
90
91
|
bubbles: true
|
|
91
92
|
});
|