Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(PanelHeaderButton, TabsItem): fix hover effect #6602

Merged
merged 4 commits into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@

switch (platform) {
case Platform.IOS:
hoverMode = 'background';
hoverMode = '';

Check warning on line 62 in packages/vkui/src/components/PanelHeaderButton/PanelHeaderButton.tsx

View check run for this annotation

Codecov / codecov/patch

packages/vkui/src/components/PanelHeaderButton/PanelHeaderButton.tsx#L62

Added line #L62 was not covered by tests
BlackySoul marked this conversation as resolved.
Show resolved Hide resolved
activeMode = 'opacity';
break;
case Platform.VKCOM:
Expand Down
5 changes: 4 additions & 1 deletion packages/vkui/src/components/TabsItem/TabsItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ import * as React from 'react';
import { classNames, hasReactNode } from '@vkontakte/vkjs';
import { useAdaptivity } from '../../hooks/useAdaptivity';
import { useExternRef } from '../../hooks/useExternRef';
import { usePlatform } from '../../hooks/usePlatform';
import { usePrevious } from '../../hooks/usePrevious';
import { SizeType } from '../../lib/adaptivity';
import { useDOM } from '../../lib/dom';
import { Platform } from '../../lib/platform';
import { warnOnce } from '../../lib/warnOnce';
import { HTMLAttributesWithRootRef } from '../../types';
import { TabsContextProps, TabsModeContext } from '../Tabs/Tabs';
Expand Down Expand Up @@ -82,6 +84,7 @@ export const TabsItem = ({
withScrollToSelectedTab,
}: TabsContextProps = React.useContext(TabsModeContext);
let statusComponent = null;
const platform = usePlatform();

const isTabFlow = role === 'tab';

Expand Down Expand Up @@ -173,7 +176,7 @@ export const TabsItem = ({
layoutFillMode !== 'auto' && fillModeClassNames[layoutFillMode],
className,
)}
hoverMode={styles['TabsItem--hover']}
hoverMode={platform === Platform.IOS ? '' : styles['TabsItem--hover']}
activeMode=""
focusVisibleMode="inside"
hasActive={false}
Expand Down
Loading