-
Notifications
You must be signed in to change notification settings - Fork 351
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
Stories rework: VaDropdown #4044
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be nice to cover stories with tests.
packages/ui/src/components/va-aspect-ratio/VaAspectRatio.stories.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work!
Left some story suggestions. We can merge after fix!
keepAnchorWidth | ||
> | ||
<template #anchor> | ||
<div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
div needed here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed it
components: { VaDropdown, VaValue, VaDropdownContent }, | ||
template: ` | ||
<VaValue #default="v" :default-value="true"> | ||
<button @click="v.value = !v.value">{{ v.value ? 'Short' : 'Long' }}</button> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No switches without big need.
Just use 2 examples in one story.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed it
`, | ||
}) | ||
|
||
export const Cursor = () => ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trigger? Has nothing to do with cursor.
See border implementation for good examples on how to implement this
http://localhost:6006/?path=/story/vaalert--border
notice default prop is not set in story - allows us to catch default regressions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How border relates to this? Didn't get it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed trigger
`, | ||
}) | ||
|
||
export const AnchorBoundProps = () => ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
export const AnchorBoundProps = () => ({ | |
export const AnchorSlotProps = () => ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamed it
<div style="height: 1000px"> | ||
<va-dropdown> | ||
<template #anchor> | ||
<va-button>Anchor</va-button> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's either use va-button everywhere or nowhere
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed it
`, | ||
}) | ||
|
||
export const Autoplacement: StoryFn = () => ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need an example for default autoplacement behavior.
It's not clear to me how using autoplacementTargetRef
differs from not using it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Default autoplacement behaviour without target doesn't seem to handle overflow properly and dropdown gets positioned outside of scroll parent. Is this needed to be showcased? I thought that in this case target needs to be specified for everything to work correctly and I doubt that improper usage should be shown
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or is current behaviour without specifying the target considered a bug?
c9f8f2e
to
f9aa185
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work, thanks!
See #3676.
Types of changes