diff --git a/packages/plasma-b2c/src/components/Popover/Popover.stories.tsx b/packages/plasma-b2c/src/components/Popover/Popover.stories.tsx index d28c0d8ca4..55373e1344 100644 --- a/packages/plasma-b2c/src/components/Popover/Popover.stories.tsx +++ b/packages/plasma-b2c/src/components/Popover/Popover.stories.tsx @@ -76,7 +76,7 @@ Live.args = { trigger: 'click', closeOnOverlayClick: true, closeOnEsc: true, - isFocusTrapped: false, + isFocusTrapped: true, skidding: 0, distance: 6, }; diff --git a/packages/plasma-core/api/plasma-core.api.md b/packages/plasma-core/api/plasma-core.api.md index 13c6fc290d..5dae0110b4 100644 --- a/packages/plasma-core/api/plasma-core.api.md +++ b/packages/plasma-core/api/plasma-core.api.md @@ -818,10 +818,10 @@ export interface PinProps { // @public export const Popover: React_2.NamedExoticComponent>; -// Warning: (ae-forgotten-export) The symbol "PopoverBasicPlacement" needs to be exported by the entry point index.d.ts +// Warning: (ae-forgotten-export) The symbol "PopoverPlacementBasic" needs to be exported by the entry point index.d.ts // // @public (undocumented) -export type PopoverPlacement = PopoverBasicPlacement | 'auto'; +export type PopoverPlacement = PopoverPlacementBasic | 'auto'; // @public (undocumented) export interface PopoverProps extends HTMLAttributes { @@ -830,12 +830,12 @@ export interface PopoverProps extends HTMLAttributes { closeOnEsc?: boolean; closeOnOverlayClick?: boolean; isFocusTrapped?: boolean; - isOpen?: boolean; + isOpen: boolean; offset?: [number, number]; onToggle?: (isOpen: boolean, event: SyntheticEvent | Event) => void; - placement?: PopoverPlacement | Array; + placement?: PopoverPlacement | Array; target?: ReactNode; - trigger: 'hover' | 'click'; + trigger?: 'hover' | 'click'; } // @public @deprecated diff --git a/packages/plasma-core/src/components/Popover/Popover.tsx b/packages/plasma-core/src/components/Popover/Popover.tsx index c51bbd381a..aad2132f54 100644 --- a/packages/plasma-core/src/components/Popover/Popover.tsx +++ b/packages/plasma-core/src/components/Popover/Popover.tsx @@ -8,22 +8,22 @@ import { useFocusTrap, useForkRef } from '../../hooks'; const ESCAPE_KEYCODE = 27; -export type PopoverBasicPlacement = 'top' | 'bottom' | 'right' | 'left'; -export type PopoverPlacement = PopoverBasicPlacement | 'auto'; +export type PopoverPlacementBasic = 'top' | 'bottom' | 'right' | 'left'; +export type PopoverPlacement = PopoverPlacementBasic | 'auto'; export interface PopoverProps extends HTMLAttributes { /** * Всплывающее окно раскрыто или нет. */ - isOpen?: boolean; + isOpen: boolean; /** * Способ всплывающего окна - наведение или клик мышью. */ - trigger: 'hover' | 'click'; + trigger?: 'hover' | 'click'; /** - * Расположение всплывающего окна. По умолчанию "auto". + * Сторона открытия окна относительно target элемента. По умолчанию "auto". */ - placement?: PopoverPlacement | Array; + placement?: PopoverPlacement | Array; /** * Отступ окна относительно элемента, у которого оно вызвано. */ @@ -41,7 +41,7 @@ export interface PopoverProps extends HTMLAttributes { */ children?: ReactNode; /** - * Блокировать ли фокус на всплывающем окне. + * Блокировать ли фокус на всплывающем окне(по умолчанию true). */ isFocusTrapped?: boolean; /** @@ -109,7 +109,7 @@ export const Popover = memo>( arrow, placement = 'auto', offset = [0, 0], - isFocusTrapped = false, + isFocusTrapped = true, closeOnOverlayClick = true, closeOnEsc = true, onToggle, diff --git a/packages/plasma-web/src/components/Popover/Popover.stories.tsx b/packages/plasma-web/src/components/Popover/Popover.stories.tsx index d962243c8f..dd3ff5b79a 100644 --- a/packages/plasma-web/src/components/Popover/Popover.stories.tsx +++ b/packages/plasma-web/src/components/Popover/Popover.stories.tsx @@ -76,7 +76,7 @@ Live.args = { trigger: 'click', closeOnOverlayClick: true, closeOnEsc: true, - isFocusTrapped: false, + isFocusTrapped: true, skidding: 0, distance: 6, };