getOverflow
Commons
stable
Calculates how much box a overflows box b on each side (before/after on both axes). Returns zero for sides where a is fully contained inside b.
API
Signature
Full TypeScript signature sourced from the util file.
API
Parameters
Input parameters accepted by this util.
- arequiredIBox
- The potentially overflowing box (e.g. a floating overlay or tooltip).
- brequiredIBox
- The bounding container box (e.g. the viewport or a scroll container).
API
Return value
The value returned by this util.
- An object with x and y axes, each containing before (left/top overflow) and after (right/bottom overflow) amounts in pixels. Values are ≥ 0.
Usage
Examples
Ready-to-paste usage snippets.
Check if a tooltip overflows the viewport