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

[EuiInputPopover] Refactor & clean ups #7241

Merged
merged 6 commits into from
Oct 2, 2023

Commits on Oct 1, 2023

  1. Configuration menu
    Copy the full SHA
    8253ede View commit details
    Browse the repository at this point in the history
  2. Refactor EuiResizeObserver to useResizeObserver

    - allows us to remove an extra unnecessary div wrapper, and it general lends itself to cleaner and more React-like code
    
    + add more detailed/clearer tests to reflect the comments added to the useEffects
    cee-chen committed Oct 1, 2023
    Configuration menu
    Copy the full SHA
    9ba6fa9 View commit details
    Browse the repository at this point in the history
  3. Clean up and memoize onKeyDown

    - [microperf] don't bother finding/iterating through tabbable items when `disableFocusTrap` is true
    
    - [microperf] Clean up unnecessary extra Array map by using `.hasAttribute()` instead
    
    - make if conditions more readable/understandable by using early returns, var names, and writing tests
    
    - pull out `closePopover` from props to add it to dependency array
    
    - remove unnecessary type
    cee-chen committed Oct 1, 2023
    Configuration menu
    Copy the full SHA
    3283c1d View commit details
    Browse the repository at this point in the history
  4. More onKeyDown cleanup

    - Remove unnecessary div by passing onKeyDown to the parent EuiPanel popover
    
    - now that the current target of the keydown event can be guaranteed to be the panel, we can remove the `panelEl` dependency from the array
    cee-chen committed Oct 1, 2023
    Configuration menu
    Copy the full SHA
    b9feb3d View commit details
    Browse the repository at this point in the history
  5. [nit] Misc code organization

    - Move classes/styling up to top of file
    - add jsdoc block
    - add clearer comments on why state is being used over refs for the input/panel refs
    cee-chen committed Oct 1, 2023
    Configuration menu
    Copy the full SHA
    f1b2ae2 View commit details
    Browse the repository at this point in the history
  6. Update downstream snapshots

    cee-chen committed Oct 1, 2023
    Configuration menu
    Copy the full SHA
    98805e0 View commit details
    Browse the repository at this point in the history