onView()
This event handler runs when a specific element becomes visible on the page.
Last updated
Was this helpful?
This event handler runs when a specific element becomes visible on the page.
Last updated
Was this helpful?
This is a prop and callback function to run custom logic when elements, specified with its sibling onViewElements
prop, enter or leave the viewport. It's called once per specified element. This function can be asynchronous.
You can use onView
to log or update form state when element visibility changes. The function takes a single object that provides form-related state and handlers.
Consistently available form state and functions
visibilityStatus
object
Reports the visibility status of elements specified in onViewElements
. Shape is { elementId: string, isVisible: boolean }
.