fix(responsive): Fix tiles not recomputing when jumping between screen sizes

This commit is contained in:
Mihai-Andrei Uscat 2021-03-05 19:31:23 +02:00 committed by Hristo Terezov
parent 82ff988c18
commit d0d32b8a19
1 changed files with 6 additions and 6 deletions

View File

@ -152,6 +152,7 @@ StateListenerRegistry.register(
* Symbol mapping used for the tile view responsiveness computation. * Symbol mapping used for the tile view responsiveness computation.
*/ */
const responsiveColumnMapping = { const responsiveColumnMapping = {
multipleColumns: Symbol('multipleColumns'),
singleColumn: Symbol('singleColumn'), singleColumn: Symbol('singleColumn'),
twoColumns: Symbol('twoColumns'), twoColumns: Symbol('twoColumns'),
twoParticipantsSingleColumn: Symbol('twoParticipantsSingleColumn') twoParticipantsSingleColumn: Symbol('twoParticipantsSingleColumn')
@ -173,14 +174,13 @@ StateListenerRegistry.register(
// Forcing the recomputation of tiles when screen switches in or out of // Forcing the recomputation of tiles when screen switches in or out of
// the (ASPECT_RATIO_BREAKPOINT, SINGLE_COLUMN_BREAKPOINT] interval. // the (ASPECT_RATIO_BREAKPOINT, SINGLE_COLUMN_BREAKPOINT] interval.
return responsiveColumnMapping.twoParticipantsSingleColumn; return responsiveColumnMapping.twoParticipantsSingleColumn;
} else if (clientWidth < SINGLE_COLUMN_BREAKPOINT) {
// Forcing the recomputation of tiles when screen switches below SINGLE_COLUMN_BREAKPOINT.
return responsiveColumnMapping.singleColumn;
} }
/** // Forcing the recomputation of tiles when screen switches above TWO_COLUMN_BREAKPOINT.
* This gets called either when the width of the screen is above {@code TWO_COLUMN_BREAKPOINT} return responsiveColumnMapping.multipleColumns;
* or below {@CODE SINGLE_COLUMN_BREAKPOINT}, however, the internal logic from {@code getMaxColumnCount}
* only takes the second case into consideration.
*/
return responsiveColumnMapping.singleColumn;
}, },
/* listener */ (_, store) => { /* listener */ (_, store) => {
const state = store.getState(); const state = store.getState();