Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[EuiTextArea] Fix consumer onChanges not firing on isClearable button click #7473

Merged
merged 4 commits into from
Jan 23, 2024

Conversation

cee-chen
Copy link
Contributor

@cee-chen cee-chen commented Jan 22, 2024

Summary

@shahzad31 caught this when trying to implement the new <EuiTextArea isClearable /> functionality in Kibana 🙏 I should have 1. written better tests and 2. followed the existing EuiFieldSearch implementation more closely, as we need to call the prototype .call() after all (as opposed to setting .value = '') in order for consumer onChange callbacks to correctly fire.

Both of the above are now fixed in this PR.

QA

  • Go to https://eui.elastic.co/pr_7473/#/forms/form-controls#textarea
  • Click the Display toggles button, and toggle clearable to true
  • Open your browser devtools to the console
  • Type in a single character into the textarea, and confirm onChange fired logs out once
  • Click the X clear button in the bottom right hand corner and confirm onChange fired logs into the console for a second time

General checklist

  • Revert [REVERT ME] commit
  • Browser QA - N/A
  • Docs site QA - N/A, bugfix
  • Code quality checklist
  • Release checklist
    • A changelog entry exists and is marked appropriately.
      - [ ] If applicable, added the breaking change issue label (and filled out the breaking change checklist)
  • Designer checklist - N/A

@cee-chen cee-chen added the bug label Jan 22, 2024
@cee-chen cee-chen self-assigned this Jan 22, 2024
@cee-chen cee-chen marked this pull request as ready for review January 22, 2024 23:14
@cee-chen cee-chen requested a review from a team as a code owner January 22, 2024 23:14
Copy link
Contributor

@1Copenut 1Copenut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 LGTM! I tested the manual QA process in our four evergreen browsers on MacOS. All behaved as expected.

@cee-chen cee-chen enabled auto-merge (squash) January 23, 2024 16:53
@kibanamachine
Copy link

Preview staging links for this PR:

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @cee-chen

@cee-chen cee-chen merged commit fdf0b7c into elastic:main Jan 23, 2024
7 checks passed
@cee-chen cee-chen deleted the textarea/clear-fix branch January 23, 2024 17:18
cee-chen added a commit to elastic/kibana that referenced this pull request Jan 30, 2024
`v92.1.1`⏩`v92.2.1`

---

## [`v92.2.1`](https://github.com/elastic/eui/releases/v92.2.1)

**Bug fixes**

- Removed unintentional i18n tokens in prior release that should not
have been exported

## [`v92.2.0`](https://github.com/elastic/eui/releases/v92.2.0)

- Updated `EuiFlyoutResizable` with new optional `onResize` callback
([#7464](elastic/eui#7464))

**Bug fixes**

- Fixed an issue in `EuiResizableContainer` where `onResizeEnd` could
become a stale closure when renders occured between resize start and
end, resulting in an outdated version of a consumer's `onResizeEnd`
callback being called
([#7468](elastic/eui#7468))
- Fixed `EuiTextArea` to correctly fire `onChange` callbacks on clear
button click ([#7473](elastic/eui#7473))
- Fixed `EuiContextMenu`'s panel titles & items to not show underlines
on hover for non-interactive elements
([#7474](elastic/eui#7474))

**Deprecations**

- Remove unused public `EuiHue` and `EuiSaturation` subcomponent
exports. Use the parent `EuiColorPicker` component instead
([#7460](elastic/eui#7460))
- Remove unused public `EuiCommentTimeline` subcomponent export. Use the
parent `EuiComment` or `EuiCommentList` components instead.
([#7467](elastic/eui#7467))
CoenWarmer pushed a commit to CoenWarmer/kibana that referenced this pull request Feb 15, 2024
`v92.1.1`⏩`v92.2.1`

---

## [`v92.2.1`](https://github.com/elastic/eui/releases/v92.2.1)

**Bug fixes**

- Removed unintentional i18n tokens in prior release that should not
have been exported

## [`v92.2.0`](https://github.com/elastic/eui/releases/v92.2.0)

- Updated `EuiFlyoutResizable` with new optional `onResize` callback
([elastic#7464](elastic/eui#7464))

**Bug fixes**

- Fixed an issue in `EuiResizableContainer` where `onResizeEnd` could
become a stale closure when renders occured between resize start and
end, resulting in an outdated version of a consumer's `onResizeEnd`
callback being called
([elastic#7468](elastic/eui#7468))
- Fixed `EuiTextArea` to correctly fire `onChange` callbacks on clear
button click ([elastic#7473](elastic/eui#7473))
- Fixed `EuiContextMenu`'s panel titles & items to not show underlines
on hover for non-interactive elements
([elastic#7474](elastic/eui#7474))

**Deprecations**

- Remove unused public `EuiHue` and `EuiSaturation` subcomponent
exports. Use the parent `EuiColorPicker` component instead
([elastic#7460](elastic/eui#7460))
- Remove unused public `EuiCommentTimeline` subcomponent export. Use the
parent `EuiComment` or `EuiCommentList` components instead.
([elastic#7467](elastic/eui#7467))
fkanout pushed a commit to fkanout/kibana that referenced this pull request Mar 4, 2024
`v92.1.1`⏩`v92.2.1`

---

## [`v92.2.1`](https://github.com/elastic/eui/releases/v92.2.1)

**Bug fixes**

- Removed unintentional i18n tokens in prior release that should not
have been exported

## [`v92.2.0`](https://github.com/elastic/eui/releases/v92.2.0)

- Updated `EuiFlyoutResizable` with new optional `onResize` callback
([elastic#7464](elastic/eui#7464))

**Bug fixes**

- Fixed an issue in `EuiResizableContainer` where `onResizeEnd` could
become a stale closure when renders occured between resize start and
end, resulting in an outdated version of a consumer's `onResizeEnd`
callback being called
([elastic#7468](elastic/eui#7468))
- Fixed `EuiTextArea` to correctly fire `onChange` callbacks on clear
button click ([elastic#7473](elastic/eui#7473))
- Fixed `EuiContextMenu`'s panel titles & items to not show underlines
on hover for non-interactive elements
([elastic#7474](elastic/eui#7474))

**Deprecations**

- Remove unused public `EuiHue` and `EuiSaturation` subcomponent
exports. Use the parent `EuiColorPicker` component instead
([elastic#7460](elastic/eui#7460))
- Remove unused public `EuiCommentTimeline` subcomponent export. Use the
parent `EuiComment` or `EuiCommentList` components instead.
([elastic#7467](elastic/eui#7467))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants