mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-23 08:58:26 +00:00
Add onClick event to Image widget (#1639)
This commit is contained in:
parent
26e0da7f54
commit
f75b5eb4d4
1 changed files with 2 additions and 2 deletions
|
|
@ -1,7 +1,7 @@
|
|||
import React from 'react';
|
||||
import LazyLoad from 'react-lazyload';
|
||||
|
||||
export const Image = function Image({ height, properties, styles }) {
|
||||
export const Image = function Image({ height, properties, styles, fireEvent }) {
|
||||
const source = properties.source;
|
||||
const widgetVisibility = styles.visibility ?? true;
|
||||
|
||||
|
|
@ -12,7 +12,7 @@ export const Image = function Image({ height, properties, styles }) {
|
|||
return (
|
||||
<div data-disabled={styles.disabledState} style={{ display: widgetVisibility ? '' : 'none' }}>
|
||||
<LazyLoad height={height} placeholder={<Placeholder />} debounce={500}>
|
||||
<img src={source} height={height} />
|
||||
<img src={source} height={height} onClick={() => fireEvent('onClick')} />
|
||||
</LazyLoad>
|
||||
</div>
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in a new issue