[fix] editing video shapes (#1821)

This PR fixes editing video shapes. The controls are now interactive
again.

### Change Type

- [x] `patch` — Bug fix

### Test Plan

1. Create a video shape.
2. Double click to edit the shape.
3. Use the controls to pause, change time, etc.

### Release Notes

- Fix bug with editing video shapes.
This commit is contained in:
Steve Ruiz 2023-08-25 07:49:06 +02:00 committed by GitHub
parent af573bac51
commit 57b2cf6955
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 3 deletions

View file

@ -554,16 +554,14 @@ input,
background-size: cover; background-size: cover;
width: 100%; width: 100%;
height: 100%; height: 100%;
pointer-events: all;
} }
.tl-image-container, .tl-image-container,
.tl-video-container,
.tl-embed-container { .tl-embed-container {
width: 100%; width: 100%;
height: 100%; height: 100%;
pointer-events: all; pointer-events: all;
/* background-color: var(--color-background); */
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;

View file

@ -161,6 +161,12 @@ const TLVideoUtilComponent = track(function TLVideoUtilComponent(props: {
if (isLoaded && !isEditing && time !== video.currentTime) { if (isLoaded && !isEditing && time !== video.currentTime) {
video.currentTime = time video.currentTime = time
} }
if (isEditing) {
if (document.activeElement !== video) {
video.focus()
}
}
}, [isEditing, isLoaded, time]) }, [isEditing, isLoaded, time])
React.useEffect(() => { React.useEffect(() => {