File tree 3 files changed +9
-3
lines changed
3 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -73,7 +73,9 @@ export const TabsBlock = ({
73
73
74
74
if ( activeTabData . caption && imageProps ) {
75
75
Object . assign ( imageProps , {
76
- 'aria-describedby' : captionId ,
76
+ extraProps : {
77
+ 'aria-describedby' : captionId ,
78
+ } ,
77
79
} ) ;
78
80
}
79
81
}
Original file line number Diff line number Diff line change 1
1
import React , {
2
2
CSSProperties ,
3
3
Fragment ,
4
+ HTMLProps ,
4
5
MouseEventHandler ,
5
6
ReactEventHandler ,
6
7
useContext ,
@@ -12,14 +13,15 @@ import {ProjectSettingsContext} from '../../context/projectSettingsContext';
12
13
import { ImageDeviceProps , ImageObjectProps , QAProps } from '../../models' ;
13
14
import { getQaAttrubutes } from '../../utils' ;
14
15
import { isCompressible } from '../../utils/imageCompress' ;
15
- import ImageBase from '../ImageBase/ImageBase' ;
16
+ import ImageBase , { ImageBaseProps } from '../ImageBase/ImageBase' ;
16
17
17
18
export interface ImageProps extends Partial < ImageObjectProps > , Partial < ImageDeviceProps > , QAProps {
18
19
style ?: CSSProperties ;
19
20
className ?: string ;
20
21
onClick ?: MouseEventHandler ;
21
22
onLoad ?: ReactEventHandler < HTMLDivElement > ;
22
23
containerClassName ?: string ;
24
+ extraProps ?: Omit < HTMLProps < HTMLImageElement > , keyof ImageBaseProps > ;
23
25
}
24
26
25
27
export interface DeviceSpecificFragmentProps extends QAProps {
@@ -66,6 +68,7 @@ const Image = (props: ImageProps) => {
66
68
onLoad,
67
69
containerClassName,
68
70
qa,
71
+ extraProps,
69
72
} = props ;
70
73
const [ imgLoadingError , setImgLoadingError ] = useState ( false ) ;
71
74
@@ -123,6 +126,7 @@ const Image = (props: ImageProps) => {
123
126
onClick = { onClick }
124
127
onError = { ( ) => setImgLoadingError ( true ) }
125
128
onLoad = { onLoad }
129
+ { ...extraProps }
126
130
/>
127
131
</ picture >
128
132
) ;
Original file line number Diff line number Diff line change @@ -124,7 +124,7 @@ interface LoopProps {
124
124
125
125
// images
126
126
127
- export interface ImageInfoProps extends Pick < HTMLProps < HTMLImageElement > , 'aria-describedby' > {
127
+ export interface ImageInfoProps {
128
128
alt ?: string ;
129
129
disableCompress ?: boolean ;
130
130
}
You can’t perform that action at this time.
0 commit comments