Skip to content

Commit

Permalink
fix(ImageBase): children position absolute (#7511)
Browse files Browse the repository at this point in the history
children стал вываливаться из ImageBase
  • Loading branch information
SevereCloud authored and actions-user committed Sep 2, 2024
1 parent dd77217 commit 91ffdf4
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
4 changes: 4 additions & 0 deletions packages/vkui/src/components/Image/Image.e2e-playground.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ export const ImagePlayground = (props: ComponentPlaygroundProps) => {
borderRadius: ['s'],
borderEndEndRadius: ['l'],
},
{
src: [base64Image],
children: ['CH'],
},
]}
>
{(props: ImageProps) => <Image {...props} />}
Expand Down
15 changes: 13 additions & 2 deletions packages/vkui/src/components/ImageBase/ImageBase.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,25 @@
background-color: transparent;
}

.ImageBase__children,
.ImageBase__border {
pointer-events: none;
position: absolute;
z-index: var(--vkui_internal--z_index_image_base_border);
inset-inline-start: 0;
inset-block-start: 0;
inline-size: 100%;
block-size: 100%;
}

.ImageBase__children {
display: inherit;
align-items: inherit;
justify-content: inherit;
border-radius: inherit;
}

.ImageBase__border {
pointer-events: none;
z-index: var(--vkui_internal--z_index_image_base_border);
box-sizing: border-box;
transform-origin: left top;
border: var(--vkui--size_border--regular) solid var(--vkui--color_image_border_alpha);
Expand Down
2 changes: 1 addition & 1 deletion packages/vkui/src/components/ImageBase/ImageBase.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ export const ImageBase: React.FC<ImageBaseProps> & {
/>
)}
{fallbackIcon && <div className={styles['ImageBase__fallback']}>{fallbackIcon}</div>}
{children}
{children && <div className={styles['ImageBase__children']}>{children}</div>}
{!noBorder && <div aria-hidden className={styles['ImageBase__border']} />}
</Clickable>
</ImageBaseContext.Provider>
Expand Down

0 comments on commit 91ffdf4

Please sign in to comment.