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

chore(scrollregion): refactor storybook #432

Merged
merged 3 commits into from
Mar 8, 2022
Merged

Conversation

jzempel
Copy link
Member

@jzempel jzempel commented Mar 8, 2022

Description

Following #420, update storybook for the scrollregion package.

Checklist

  • 🌐 Storybook demo is up-to-date (yarn start)
  • β™Ώ analyzed via axe and evaluated using VoiceOver
  • πŸ’‚β€β™‚οΈ includes new unit tests
  • πŸ“ tested in Chrome, Firefox, Safari, Edge, and IE11

@jzempel jzempel requested a review from a team as a code owner March 8, 2022 16:32
@coveralls
Copy link

coveralls commented Mar 8, 2022

Coverage Status

Coverage remained the same at 95.868% when pulling 73edd5a on jzempel/demo-scrollregion into 48dff02 on main.

props.tabIndex === 0 ? 'border-blue-600' : 'border-grey-300'
)}
style={{ height, width }}
ref={ref as RefObject<HTMLDivElement>}
Copy link

@mtomcal mtomcal Mar 8, 2022

Choose a reason for hiding this comment

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

Just out of curiosity, why do we do forwardRef<HTMLElement, X> versus forwardRef<HTMLDivElement, X> and cast to a RefObject<HTMLDivElement> here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, this has a bad code smell. And it goes all the way back to the container API. I've updated the container interfaces with generics that take HTMLElement as a default, but can be overridden in order to specify the containerRef type (which, in the case of this story should be HTMLDivElement).

We should get better at using generics throughout Garden. πŸ˜‰

@jzempel jzempel merged commit 15bf8ac into main Mar 8, 2022
@jzempel jzempel deleted the jzempel/demo-scrollregion branch March 8, 2022 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

5 participants