Web:Components:Fixed dropdown for the list of roles of room users, so that if less than 5 in the list, then the dropdown was on the button.

This commit is contained in:
Vlada Gazizova 2022-12-12 23:38:27 +03:00
parent 273d4cc8d5
commit c9e1c702e6

View File

@ -140,7 +140,18 @@ class ComboBox extends React.Component {
let optionsCount = optionsLength;
if (withAdvancedOptions) {
optionsCount = advancedOptionsCount ? advancedOptionsCount : 6;
const advancedOptionsWithoutSeparator = advancedOptions.props.children.filter(
(option) => option.key !== "s1"
);
const advancedOptionsWithoutSeparatorLength =
advancedOptionsWithoutSeparator.length;
optionsCount = advancedOptionsCount
? advancedOptionsCount
: advancedOptionsWithoutSeparatorLength
? advancedOptionsWithoutSeparatorLength
: 6;
}
const disableMobileView = optionsCount < 5;