From 03ab52f81414a71480ac168a67f7a06acb824651 Mon Sep 17 00:00:00 2001 From: Fedor Katurov Date: Mon, 10 Jan 2022 10:02:19 +0700 Subject: [PATCH] fixed popeper placement --- src/components/containers/Sticky/index.tsx | 14 ++++++-------- src/components/tags/TagAutocomplete/index.tsx | 1 + src/containers/tags/TagInput/index.tsx | 2 +- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/components/containers/Sticky/index.tsx b/src/components/containers/Sticky/index.tsx index 232db8ff..15de9b7e 100644 --- a/src/components/containers/Sticky/index.tsx +++ b/src/components/containers/Sticky/index.tsx @@ -1,16 +1,14 @@ import React, { DetailsHTMLAttributes, FC } from 'react'; -import StickyBox from 'react-stickynode'; +import StickyBox from 'react-sticky-box'; interface IProps extends DetailsHTMLAttributes { offsetTop?: number; } -const Sticky: FC = ({ children, offsetTop = 65 }) => { - return ( - - {children} - - ); -}; +const Sticky: FC = ({ children, offsetTop = 65 }) => ( + + {children} + +); export { Sticky }; diff --git a/src/components/tags/TagAutocomplete/index.tsx b/src/components/tags/TagAutocomplete/index.tsx index 3949c267..b16ac0c5 100644 --- a/src/components/tags/TagAutocomplete/index.tsx +++ b/src/components/tags/TagAutocomplete/index.tsx @@ -35,6 +35,7 @@ const TagAutocomplete: VFC = ({ const pop = usePopper(wrapper?.current?.parentElement, wrapper.current, { placement: 'bottom-end', + strategy: 'fixed', modifiers: [ { name: 'offset', diff --git a/src/containers/tags/TagInput/index.tsx b/src/containers/tags/TagInput/index.tsx index e8da7c0c..03dfd502 100644 --- a/src/containers/tags/TagInput/index.tsx +++ b/src/containers/tags/TagInput/index.tsx @@ -101,8 +101,8 @@ const TagInput: FC = ({ exclude, onAppend, onClearTag, onSubmit }) => { const onAutocompleteSelect = useCallback( (val: string) => { - onAppend([val]); setInput(''); + onAppend([val]); }, [onAppend, setInput] );