
React Server Components and the Next.js App Router enable streaming and smaller client bundles, but only when used correctly. This article explores six common mistakes that block streaming, bloat hydration, and create stale UI in production.

Gil Fink (SparXis CEO) joins PodRocket to break down todayâs most common web rendering patterns: SSR, CSR, static rednering, and islands/resumability.

@container scroll-state: Replace JS scroll listeners nowCSS @container scroll-state lets you build sticky headers, snapping carousels, and scroll indicators without JavaScript. Hereâs how to replace scroll listeners with clean, declarative state queries.

Explore 10 Web APIs that replace common JavaScript libraries and reduce npm dependencies, bundle size, and performance overhead.
Hey there, want to help make our blog better?
Join LogRocketâs Content Advisory Board. Youâll help inform the type of content we create and get access to exclusive meetups, social accreditation, and swag.
Sign up now
5 Replies to "Building a long-press directive in Vue"
Really cool. Thanks
But click event will be triggered alongside longpress. Is there any approach how to prevent it?
Thanks a lot
Thanks for this well written post. I have a long-press button (a push-to-talk application that keeps the mic on only while the button is being held down) and it’s working fine, but one of the beta testers kept moving the mouse while holding it down so the mouse-up event often didn’t fire on the button itself but on a different component. Is that common and is there a workaround that could call a method on the longpress component even if the mouse-up occurs elsewhere on the page? (The component maintains its state so if it’s not in the “recording” state, that would be a no-op.)
Thank you for the post. When I handle the longpress event, it is getting triggered continuously as soon as I launch the app. Any idea what I am missing?