diff --git a/src/components/Controls/ControlsLayout.tsx b/src/components/Controls/ControlsLayout.tsx index 1f1dd7c5..9445f095 100644 --- a/src/components/Controls/ControlsLayout.tsx +++ b/src/components/Controls/ControlsLayout.tsx @@ -7,6 +7,7 @@ import {ControlSizes} from '../../models'; type ControlsLayoutProps = { isWideView?: boolean; + isMobileView?: boolean; isVerticalView?: boolean; controlClassName?: string; controlSize?: ControlSizes; @@ -16,6 +17,7 @@ type ControlsLayoutProps = { export const ControlsLayoutContext = createContext({ controlClassName: '', isWideView: false, + isMobileView: false, isVerticalView: false, controlSize: ControlSizes.M, popupPosition: PopperPosition.BOTTOM_END, @@ -25,6 +27,7 @@ const b = block('dc-controls'); export const ControlsLayout: React.FC> = ({ isWideView, + isMobileView, isVerticalView, controlClassName, controlSize, @@ -36,6 +39,7 @@ export const ControlsLayout: React.FC> = value={{ controlClassName: controlClassName || b('control'), isWideView: isWideView, + isMobileView: isMobileView, isVerticalView: isVerticalView, controlSize: controlSize, popupPosition: popupPosition, diff --git a/src/components/Controls/single-controls/SettingsControl/SettingsControl.scss b/src/components/Controls/single-controls/SettingsControl/SettingsControl.scss index dfea0cef..b7bd4877 100644 --- a/src/components/Controls/single-controls/SettingsControl/SettingsControl.scss +++ b/src/components/Controls/single-controls/SettingsControl/SettingsControl.scss @@ -29,14 +29,34 @@ @include text-size(body-1); } - &__popup-tooltip { + &__popup-tooltip-content { padding: 0; } + @media (max-width: map-get($screenBreakpoints, 'md')) { + &__popup { + width: 100vw; + } + + &__popup-tooltip { + position: fixed; + inset: var(--header-height) 0px auto 0px !important; + transform: translate3d(0,0,0) !important; + } + + &__popup-tooltip-content { + max-width: 100%; + } + } + &__list { padding: 4px 0; width: 230px; + &_mobile { + width: 100%; + } + .yc-list__item_active { background: transparent; } diff --git a/src/components/Controls/single-controls/SettingsControl/SettingsControl.tsx b/src/components/Controls/single-controls/SettingsControl/SettingsControl.tsx index 06aa63c6..1706931a 100644 --- a/src/components/Controls/single-controls/SettingsControl/SettingsControl.tsx +++ b/src/components/Controls/single-controls/SettingsControl/SettingsControl.tsx @@ -36,7 +36,7 @@ interface SettingControlItem { const SettingsControl = (props: ControlProps) => { const {t} = useTranslation('controls'); - const {controlClassName, controlSize, isVerticalView, isWideView, popupPosition} = + const {controlClassName, controlSize, isVerticalView, isWideView, isMobileView, popupPosition} = useContext(ControlsLayoutContext); const { textSize, @@ -177,13 +177,23 @@ const SettingsControl = (props: ControlProps) => { onOpenChange={setIsVisiblePopup} placement={getPopupPosition(isVerticalView)} className={controlClassName} - contentClassName={b('popup')} - tooltipContentClassName={b('popup-tooltip')} + contentClassName={b('popup', { + mobile: isMobileView, + })} + tooltipClassName={b('popup-tooltip', { + mobile: isMobileView, + })} + tooltipContentClassName={b('popup-tooltip-content', { + mobile: isMobileView, + })} + hasArrow={!isMobileView} content={