@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.
@@ -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 ref, then dispatch an input event in order to trigger handleChange
179
- input.value = "";
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
 
@@ -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 ref, then dispatch an input event in order to trigger handleChange
105
- input.value = "";
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
  });
@@ -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 ref, then dispatch an input event in order to trigger handleChange
88
- input.value = "";
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
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sproutsocial/racine",
3
- "version": "11.6.1-input-beta.2",
3
+ "version": "11.6.1-input-beta.3",
4
4
  "license": "MIT",
5
5
  "files": [
6
6
  "__flow__",