-
Notifications
You must be signed in to change notification settings - Fork 1.3k
docs: Add examples section #9094
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
base: main
Are you sure you want to change the base?
Conversation
| let press = pressScale(domRef, UNSAFE_style); | ||
| if (ElementType === 'div' && !isSkeleton && props.href) { | ||
| // Standalone Card that has an href should be rendered as a Link. | ||
| // NOTE: In this case, the card must not contain interactive elements. |
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.
We don't really have a way to enforce this...
| let estimatedSize = true; | ||
| if (oldLayoutInfo) { | ||
| height = oldLayoutInfo.rect.height; | ||
| height = oldLayoutInfo.rect.height / oldLayoutInfo.rect.width * itemWidth; |
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.
If the card size changes (e.g. user drags slider in photo library example), re-calculate the height proportionally.
| // Figure out which column to place the item in, and compute its position. | ||
| // Preserve the previous column index so items don't jump around during resizing unless the number of columns changed. | ||
| let prevColumn = numColumns === this.numColumns && oldLayoutInfo && oldLayoutInfo.rect.y < this.virtualizer!.visibleRect.maxY ? oldLayoutInfo.column : undefined; | ||
| let prevColumn = numColumns === this.numColumns && oldLayoutInfo && oldLayoutInfo.index === index && oldLayoutInfo.rect.y < this.virtualizer!.visibleRect.maxY ? oldLayoutInfo.column : undefined; |
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.
Don't preserve the column if the index within the collection changed. When filtering the photo library, the cards were staying where they were previously, resulting in "holes" appearing. We want to re-flow in this case.
|
Build successful! 🎉 |
|
Build successful! 🎉 |
|
Build successful! 🎉 |
Adds examples section to new RAC docs. Ports over a few examples from the old docs, and adds a few new ones.
A few other bug fixes are included:
size()macro to returncalcdirectly without wrapping in square brackets, enabling it to be interpolated into CSS strings.font-variation-settingsfrom the Spectrum macro theme now that the Typekit issue has been fixed for a while. This was causing incorrect fonts to display in Tailwind and Vanilla CSS examples which were not overriding it.href. Such cards must not have interactive elements within them.