-
- Downloads
[FIX] website, *: always allow scroll for popup taller than window
*: web_editor
Steps to reproduce:
- Activate the cookie dialog from the website settings
- Remove the backdrop from the cookie dialog
- Add some blocks to the cookie dialog in the website editor
until the dialog height is bigger than the page height.
Result:
The cookie dialog is not scrollable, so it's impossible to reach
the "I agree" button and close the dialog, leaving the user stuck
at the first page.
I check if the popup content is higher than the window. If it is, I
give priority to the popup scroll over the page one. I had to
overwrite the _showElement method to call _setScrollbar after
the content rendering, in this way I can get its correct height.
I also try to update the scrollbar each time a block in the cookie bar
has been changed and each time the window resize. This is optimize, so
if the overflow isn't changed from the last time I tried to update the
scrollbar no action will be taken. In this way you can always see the
whole popup without refreshing the page.
Also I have to set 'pointer-events' to none only if the popup is
smaller than the page itself (to interact with and scroll the
page behind), otherwise the popup won't be scrollable. I did
this by adding a class "s_popup_overflow_page" if the popup is
higher than the page and I adapted the pointer-events
property accordingly.
opw-2660786
closes odoo/odoo#80092
Signed-off-by:
Quentin Smetz (qsm) <qsm@odoo.com>
Showing
- addons/web_editor/static/src/js/editor/snippets.editor.js 5 additions, 0 deletionsaddons/web_editor/static/src/js/editor/snippets.editor.js
- addons/website/static/src/snippets/s_popup/000.js 45 additions, 4 deletionsaddons/website/static/src/snippets/s_popup/000.js
- addons/website/static/src/snippets/s_popup/001.scss 6 additions, 1 deletionaddons/website/static/src/snippets/s_popup/001.scss
- addons/website/static/src/snippets/s_popup/options.js 6 additions, 0 deletionsaddons/website/static/src/snippets/s_popup/options.js
Loading
Please register or sign in to comment