1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-24 20:36:40 +07:00

fixed popeper placement

This commit is contained in:
Fedor Katurov 2022-01-10 10:02:19 +07:00
parent 0a5caf6bda
commit 03ab52f814
3 changed files with 8 additions and 9 deletions

View file

@ -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<HTMLDivElement> {
offsetTop?: number;
}
const Sticky: FC<IProps> = ({ children, offsetTop = 65 }) => {
return (
<StickyBox offsetTop={offsetTop} offsetBottom={10}>
{children}
</StickyBox>
);
};
const Sticky: FC<IProps> = ({ children, offsetTop = 65 }) => (
<StickyBox offsetTop={offsetTop} offsetBottom={10}>
{children}
</StickyBox>
);
export { Sticky };

View file

@ -35,6 +35,7 @@ const TagAutocomplete: VFC<TagAutocompleteProps> = ({
const pop = usePopper(wrapper?.current?.parentElement, wrapper.current, {
placement: 'bottom-end',
strategy: 'fixed',
modifiers: [
{
name: 'offset',

View file

@ -101,8 +101,8 @@ const TagInput: FC<IProps> = ({ exclude, onAppend, onClearTag, onSubmit }) => {
const onAutocompleteSelect = useCallback(
(val: string) => {
onAppend([val]);
setInput('');
onAppend([val]);
},
[onAppend, setInput]
);