Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
The lastInputTime
read-only property of the LayoutShift
interface returns the time of the most recent excluding input or 0
if no excluding input has occurred.
Layout shifts are only bad if the user wasn't expecting them. Many layout shift metrics (like Cumulative Layout Shift (CLS)) exclude shifts that occurred soon after certain user interactions. These interactions are called excluding inputs. Excluding inputs are:
- Any events which signal a user's active interaction with the document: (
mousedown
,keydown
, andpointerdown
) - Any events which directly changes the size of the viewport.
-
change
events.
The mousemove
and pointermove
events are not excluding inputs.