Conversation
TDaglis
marked this pull request as ready for review
October 2, 2026 17:37
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related:
Fixes #1863
Related: #1090
Description:
Fixes two bugs in
SliderVideo(TimeSlider.Videoin React,<media-slider-video>as a custom element):#hasError()checkedisNull(error), which tests the signal function itself, and that is nevernull. As a resultdata-errorwas always set andhiddenwas true whenever the player could load, so the default theme (.vds-slider-video[data-hidden] { display: none }) never showed the preview. It now reads the value withisNull(error()), matchingThumbnailandPoster.TimeSlider.Videoattaches the component to the same<video>it listens to forerror.#onError()redispatchederroron that element and re-entered itself until the stack overflowed, calling theonErrorprop at every level. It now returns early for its own event (event.target === this, since Maverick'sdispatch()setstargetto the component). Native errors, whose target is the<video>, are still handled.Adds
slider-video.test.ts, covering a valid preview, an error with the video as the host (React) and inside the host (custom element), recovery after a source change, and seeking the preview to the pointer position.Ready?
Yes.
Anything Else?
Reproduction with
@vidstack/react@1.15.6: https://stackblitz.com/github/TDaglis/examples/tree/slider-video-repro/player/react/slider-video-repro?file=src/player.tsxChecked in a browser against the published
@vidstack/react@1.15.6and against this branch (React sandbox):data-error,data-hidden,display: noneonError× 44, thenRangeError: Maximum call stack size exceededonError× 1, hiddenVitest resolves Maverick's server build, where
dispatch()is a no-op, so the test re-creates the browser dispatch (including thetargetoverride) on a jsdom element. It caps recursion so the pre-fix run fails without overflowing the runner.pnpm format:check,pnpm typecheck,pnpm buildandpnpm testpass locally (Node 22, pnpm 8.7.0).Review Process:
data-error: trueanddisplay: none, and the missing preview counts dozens ofonErrorcalls.pnpm -F vidstack exec vitest --run src/components/ui/sliders/slider-video.test.tspasses; withslider-video.tsreverted, 3 of the 5 tests fail.TimeSlider.Videowith the default theme and one valid and one missingsrc. The valid preview is visible on hover, and the missing one firesonErroronce.