From ad6cde3181efd28c401dea3b190e18bdcf36e631 Mon Sep 17 00:00:00 2001 From: luvi Date: Mon, 2 Jan 2023 13:43:23 +0000 Subject: [PATCH] [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): https://github.com/odoo/odoo/commit/c21c415f3865b73c6dee9c9cf92224e684226f36 closes odoo/documentation#3261 Signed-off-by: Luca Vitali --- content/developer/reference/frontend/hooks.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/content/developer/reference/frontend/hooks.rst b/content/developer/reference/frontend/hooks.rst index e6ec24c57..41cfecb0e 100644 --- a/content/developer/reference/frontend/hooks.rst +++ b/content/developer/reference/frontend/hooks.rst @@ -242,10 +242,12 @@ API - the desired position. It is a string composed of one `Direction` and one `Variant` separated by a dash character. `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 `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`, - `left`. (default position: `bottom`) + `left`, `bottom-fit`. (default position: `bottom`) * - `onPositioned` - (el: HTMLElement, position: PositioningSolution) => void - a callback that will be called everytime a positioning occurs