File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -189,6 +189,8 @@ export interface UPlotProps {
189189 margin ?: { title ?: number ; legend ?: number } ;
190190 /** Callback for messages from the WebView */
191191 onMessage ?: ( event : any ) => void ;
192+ /** Callback when the WebView has loaded */
193+ onLoad ?: ( ( ) => void ) | null ;
192194 /** JavaScript to be injected into the WebView */
193195 injectedJavaScript ?: string ;
194196 /** Additional props for the WebView */
@@ -204,6 +206,7 @@ const ChartUPlot = forwardRef<any, UPlotProps>(
204206 functions,
205207 margin = { title : MARGIN_TITLE , legend : MARGIN_LEGEND } ,
206208 onMessage,
209+ onLoad = null ,
207210 injectedJavaScript = '' ,
208211 ...webviewProps
209212 } ,
@@ -573,6 +576,10 @@ const ChartUPlot = forwardRef<any, UPlotProps>(
573576 scrollEnabled = { false }
574577 onLoadEnd = { ( ) : void => {
575578 createChart ( optionsFinal , data , bgColor ) ;
579+
580+ if ( onLoad ) {
581+ onLoad ( ) ;
582+ }
576583 } }
577584 ref = { ( r ) => {
578585 if ( r ) {
You can’t perform that action at this time.
0 commit comments