Skip to content

[DRAFT] Textarea upgrade#3664

Closed
snide wants to merge 8 commits intoelastic:masterfrom
snide:kql/wide
Closed

[DRAFT] Textarea upgrade#3664
snide wants to merge 8 commits intoelastic:masterfrom
snide:kql/wide

Conversation

@snide
Copy link
Copy Markdown
Contributor

@snide snide commented Jun 26, 2020

Summary

Makes textareas similar to our other EuiField based inputs, wrapping them in EuiFormControlLayout. Textareas now have the ability to have loading, readonly, prepend and append states. Additionally there are new props for autoHeight and maxHeight that when used, give the ability for textareas to autosize to the content when you start writing in them.

textarea

TODO

  • Tests
  • Write up a better docs desc
  • Rework EuiSuggest to make use of the new textarea
  • Some typescript checking / refactoring

Checklist

  • Check against all themes for compatibility in both light and dark modes
  • Checked in mobile
  • Checked in IE11 and Firefox
  • Props have proper autodocs
  • Added documentation
  • Checked Code Sandbox works for the any docs examples
  • Added or updated jest tests
  • Checked for breaking changes and labeled appropriately
  • Checked for accessibility including keyboard-only and screenreader modes
  • A changelog entry exists and is marked appropriately


import { htmlIdGenerator } from '../../../services';

export const useCombinedRefs = <T extends any>(
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@thompsongl This seems to work, but I don't know if it's very elegant? If we keep it I guess it could be a small service? The refs check has a TS error that I didn't know how to resolve.

@snide
Copy link
Copy Markdown
Contributor Author

snide commented Jun 26, 2020

cc @spong. Haven't forgotten about this one. I'm hopeful I can get this implemented into Kibana sometime next week.

@snide
Copy link
Copy Markdown
Contributor Author

snide commented Jun 26, 2020

An update. I took some of this code into Kibana and was able to pretty easily replicate the functionality with the current KQL bar. This EUI version is more complicated (because it has to consider the textarea in so many different scenarios).

End result, I'm probably going to put up a PR on the Kibana side to cover the functionality we want for 7.9 that isn't dependent on this work. This EUI version can lag, and might be questionable (it adds a lot of magical complexity) as a default part of the component. Will chat with @thompsongl and @cchaos about that portion next week.

@thompsongl
Copy link
Copy Markdown
Contributor

Some clean up work in snide#12 that we can look at next week

@kibanamachine
Copy link
Copy Markdown

Preview documentation changes for this PR: https://eui.elastic.co/pr_3664/

@snide
Copy link
Copy Markdown
Contributor Author

snide commented Jul 2, 2020

Just a note since I'll be out for a couple weeks. We're gonna keep this PR in EUI, because it's useful for other components (like the markdown editor). I'll get it cleaned up when I get back. In the meantime, the Kibana PR is moving along and will ship with 7.9. It work on similar, but simpler logic.

@snide
Copy link
Copy Markdown
Contributor Author

snide commented Oct 20, 2020

I'm closing this one out. We covered this on the Kibana side and I haven't seen much need to add something this prone to misuse in EUI directly. We can always revisit later if we need it.

@snide snide closed this Oct 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants