File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
client/packages/lowcoder/src/comps/comps/fileComp Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -69,6 +69,8 @@ export const ImageCaptureModal = (props: {
6969 if ( props . showModal ) {
7070 setImgSrc ( "" ) ;
7171 setErrMessage ( "" ) ;
72+ setVideoConstraints ( { facingMode : "environment" } ) ;
73+ setDropdownShow ( false ) ;
7274 }
7375 } , [ props . showModal ] ) ;
7476
@@ -119,9 +121,11 @@ export const ImageCaptureModal = (props: {
119121 ) : (
120122 < Suspense fallback = { < Skeleton /> } >
121123 < ReactWebcam
124+ key = { JSON . stringify ( videoConstraints ) }
122125 ref = { webcamRef }
123126 onUserMediaError = { handleMediaErr }
124127 screenshotFormat = "image/jpeg"
128+ videoConstraints = { videoConstraints }
125129 />
126130 </ Suspense >
127131 ) }
@@ -167,9 +171,10 @@ export const ImageCaptureModal = (props: {
167171 popupRender = { ( ) => (
168172 < Menu
169173 items = { modeList }
170- onClick = { ( value ) =>
171- setVideoConstraints ( { ...videoConstraints , deviceId : value . key } )
172- }
174+ onClick = { ( value ) => {
175+ setVideoConstraints ( { deviceId : { exact : value . key } } ) ;
176+ setDropdownShow ( false ) ;
177+ } }
173178 />
174179 ) }
175180 >
You can’t perform that action at this time.
0 commit comments