[IMP] web: update usePosition API

This commit updates the documentation of the position hook, to add
the latest variant "fit". This variant was introduced recently in
commit (1), when using it in the SelectMenu component.

(1): c21c415f38

closes odoo/documentation#3261

Signed-off-by: Luca Vitali <luvi@odoo.com>
This commit is contained in:
luvi 2023-01-02 13:43:23 +00:00
parent bca9ac151f
commit ad6cde3181

View File

@ -242,10 +242,12 @@ API
- the desired position. It is a string composed of one `Direction` and one - the desired position. It is a string composed of one `Direction` and one
`Variant` separated by a dash character. `Variant` separated by a dash character.
`Direction` could be: `top`, `bottom`, `right`, `left`. `Direction` could be: `top`, `bottom`, `right`, `left`.
`Variant` could be: `start`, `middle`, `end`. `Variant` could be: `start`, `middle`, `end`, `fit`.
The variant can be omitted (default variant is `middle`). The variant can be omitted (default variant is `middle`).
The `fit` variant means that the popper would have the exact same width or height,
depending on the chosen direction.
Examples of valid positions: `right-end`, `top-start`, `left-middle`, Examples of valid positions: `right-end`, `top-start`, `left-middle`,
`left`. (default position: `bottom`) `left`, `bottom-fit`. (default position: `bottom`)
* - `onPositioned` * - `onPositioned`
- (el: HTMLElement, position: PositioningSolution) => void - (el: HTMLElement, position: PositioningSolution) => void
- a callback that will be called everytime a positioning occurs - a callback that will be called everytime a positioning occurs