Skip to content

Commit

Permalink
Merge branch 'main' into feat-aside-header-top-block
Browse files Browse the repository at this point in the history
  • Loading branch information
goshander authored Oct 2, 2023
2 parents ba3499f + 2abc163 commit af5a259
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 7 deletions.
11 changes: 11 additions & 0 deletions .storybook/focus-addon/register.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import {addons, } from '@storybook/addons';

addons.register('initialFocus', () => {
addons.getChannel().on('currentStoryWasSet', () => focusIframe());
})

const focusIframe = () => {
const previewIframe: HTMLInputElement | null = document.querySelector('#storybook-preview-iframe');

previewIframe?.focus?.();
}
3 changes: 2 additions & 1 deletion .storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ const config: StorybookConfig = {
'@storybook/addon-interactions',
'@storybook/preset-scss',
'storybook-preset-inline-svg',
'./theme-addon/register.tsx'
'./theme-addon/register.tsx',
'./focus-addon/register.tsx'
],
framework: {
name: '@storybook/react-webpack5',
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## [0.22.1](https://github.com/gravity-ui/navigation/compare/v0.22.0...v0.22.1) (2023-10-02)


### Bug Fixes

* **AsideHeader:** return export AsideHeaderProps ([#119](https://github.com/gravity-ui/navigation/issues/119)) ([1ba6f85](https://github.com/gravity-ui/navigation/commit/1ba6f856479d22cb4330341a7164dee3e432e0cb))
* **CompositeBar:** fix stucking multipleTooltip ([#117](https://github.com/gravity-ui/navigation/issues/117)) ([be6534e](https://github.com/gravity-ui/navigation/commit/be6534e1a6f49dd8ce1e1dde1aba837b661baf19))

## [0.22.0](https://github.com/gravity-ui/navigation/compare/v0.21.1...v0.22.0) (2023-09-29)


Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gravity-ui/navigation",
"version": "0.22.0",
"version": "0.22.1",
"description": "Gravity UI Navigation components",
"license": "MIT",
"repository": {
Expand Down
8 changes: 4 additions & 4 deletions src/components/CompositeBar/CompositeBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ const CompositeBarView: FC<CompositeBarViewProps> = ({

const onMouseEnterByIndex = useCallback(
(itemIndex) => () => {
if (multipleTooltip) {
if (multipleTooltip && document.hasFocus()) {
let multipleTooltipActiveValue = multipleTooltipActive;
if (!multipleTooltipActive && itemIndex !== lastClickedItemIndex) {
multipleTooltipActiveValue = true;
Expand All @@ -139,7 +139,7 @@ const CompositeBarView: FC<CompositeBarViewProps> = ({
);

const onMouseLeave = useCallback(() => {
if (compact) {
if (compact && document.hasFocus()) {
ref.current?.activateItem(undefined as unknown as number);
if (
multipleTooltip &&
Expand Down Expand Up @@ -220,9 +220,9 @@ const CompositeBarView: FC<CompositeBarViewProps> = ({
}}
/>
</div>
{type === 'menu' && (
{type === 'menu' && multipleTooltip && (
<MultipleTooltip
open={compact && multipleTooltip && multipleTooltipActive}
open={compact && multipleTooltipActive}
anchorRef={tooltipRef}
placement={['right-start']}
items={items}
Expand Down
1 change: 1 addition & 0 deletions src/components/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export {AsideHeader} from './AsideHeader/AsideHeader';
export type {AsideHeaderProps} from './AsideHeader/types';
export {AsideHeaderContextProvider, useAsideHeaderContext} from './AsideHeader/AsideHeaderContext';
export {Drawer, DrawerProps, DrawerItemProps, DrawerItem} from './Drawer/Drawer';
export {FooterItem, FooterItemProps} from './FooterItem/FooterItem';
Expand Down

0 comments on commit af5a259

Please sign in to comment.