From d0d32b8a19115e65249258703063f19b24b67176 Mon Sep 17 00:00:00 2001 From: Mihai-Andrei Uscat Date: Fri, 5 Mar 2021 19:31:23 +0200 Subject: [PATCH] fix(responsive): Fix tiles not recomputing when jumping between screen sizes --- react/features/filmstrip/subscriber.web.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/react/features/filmstrip/subscriber.web.js b/react/features/filmstrip/subscriber.web.js index 3af7fbe3b..0f046a50d 100644 --- a/react/features/filmstrip/subscriber.web.js +++ b/react/features/filmstrip/subscriber.web.js @@ -152,6 +152,7 @@ StateListenerRegistry.register( * Symbol mapping used for the tile view responsiveness computation. */ const responsiveColumnMapping = { + multipleColumns: Symbol('multipleColumns'), singleColumn: Symbol('singleColumn'), twoColumns: Symbol('twoColumns'), twoParticipantsSingleColumn: Symbol('twoParticipantsSingleColumn') @@ -173,14 +174,13 @@ StateListenerRegistry.register( // Forcing the recomputation of tiles when screen switches in or out of // the (ASPECT_RATIO_BREAKPOINT, SINGLE_COLUMN_BREAKPOINT] interval. return responsiveColumnMapping.twoParticipantsSingleColumn; + } else if (clientWidth < SINGLE_COLUMN_BREAKPOINT) { + // Forcing the recomputation of tiles when screen switches below SINGLE_COLUMN_BREAKPOINT. + return responsiveColumnMapping.singleColumn; } - /** - * This gets called either when the width of the screen is above {@code TWO_COLUMN_BREAKPOINT} - * or below {@CODE SINGLE_COLUMN_BREAKPOINT}, however, the internal logic from {@code getMaxColumnCount} - * only takes the second case into consideration. - */ - return responsiveColumnMapping.singleColumn; + // Forcing the recomputation of tiles when screen switches above TWO_COLUMN_BREAKPOINT. + return responsiveColumnMapping.multipleColumns; }, /* listener */ (_, store) => { const state = store.getState();