fix: dispatch input event for textarea (#60107)

This commit is contained in:
Shaurya Bisht
2025-05-14 19:16:59 +05:30
committed by GitHub
parent f50fc7ca1d
commit c150748ac8
@@ -219,6 +219,7 @@ Once the value of `#complaint-description` is changed to a valid value, you shou
```js
const field = document.getElementById("complaint-description");
field.value = "A sentence with at least twenty characters"
field.dispatchEvent(new Event("input", { bubbles: true }));
field.dispatchEvent(new Event("change", { bubbles: true }));
assert.equal(field.style.borderColor, "green");
```
@@ -228,6 +229,7 @@ Once the value of `#complaint-description` is changed to an invalid value, you s
```js
const field = document.getElementById("complaint-description");
field.value = "Not enough chars"
field.dispatchEvent(new Event("input", { bubbles: true }));
field.dispatchEvent(new Event("change", { bubbles: true }));
assert.equal(field.style.borderColor, "red");
```
@@ -293,6 +295,7 @@ Once the value of `#solution-description` is changed to a valid value, you shoul
```js
const field = document.getElementById("solution-description");
field.value = "A sentence with at least twenty characters"
field.dispatchEvent(new Event("input", { bubbles: true }));
field.dispatchEvent(new Event("change", { bubbles: true }));
assert.equal(field.style.borderColor, "green");
```
@@ -302,6 +305,7 @@ Once the value of `#solution-description` is changed to an invalid value, you sh
```js
const field = document.getElementById("solution-description");
field.value = "Not enough chars"
field.dispatchEvent(new Event("input", { bubbles: true }));
field.dispatchEvent(new Event("change", { bubbles: true }));
assert.equal(field.style.borderColor, "red");
```