jesperct commented on code in PR #40805:
URL: https://github.com/apache/superset/pull/40805#discussion_r3364673341
##########
superset-frontend/src/components/MessageToasts/ToastPresenter.tsx:
##########
@@ -37,7 +37,9 @@ const StyledToastPresenter = styled.div<VisualProps>(
z-index: ${theme.zIndexPopupBase + 1};
word-break: break-word;
- height: calc(100vh - 100px);
+ /* Cap height for scrolling, but hug the toasts so the fixed overlay does
not
+ reserve the full viewport and block controls underneath it. */
+ max-height: calc(100vh - 100px);
Review Comment:
The description and title were updated to the max-height approach after the
rework, so they now match the code. The pointer-events wording is gone.
##########
superset-frontend/src/components/MessageToasts/ToastPresenter.test.tsx:
##########
@@ -47,3 +47,12 @@ test('should pass removeToast to the Toast component', async
() => {
fireEvent.click(getAllByTestId('close-button')[0]);
await waitFor(() => expect(removeToast).toHaveBeenCalledTimes(1));
});
+
+test('presenter caps its height with max-height so it hugs the toasts', () => {
+ // A fixed `height` would make the fixed overlay span the viewport and block
+ // controls underneath it; `max-height` lets it shrink to the toasts while
+ // still scrolling when they overflow.
+ const presenter = setup().container.querySelector('#toast-presenter');
+ expect(presenter).toHaveStyleRule('max-height', 'calc(100vh - 100px)');
+ expect(presenter).not.toHaveStyleRule('height', 'calc(100vh - 100px)');
Review Comment:
Added an explicit `expect(presenter).toBeInTheDocument()` before the style
assertions in 418f736.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]