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 React, { DetailsHTMLAttributes, FC } from 'react';
import StickyBox from 'react-stickynode'; import StickyBox from 'react-sticky-box';
interface IProps extends DetailsHTMLAttributes<HTMLDivElement> { interface IProps extends DetailsHTMLAttributes<HTMLDivElement> {
offsetTop?: number; offsetTop?: number;
} }
const Sticky: FC<IProps> = ({ children, offsetTop = 65 }) => { const Sticky: FC<IProps> = ({ children, offsetTop = 65 }) => (
return ( <StickyBox offsetTop={offsetTop} offsetBottom={10}>
<StickyBox offsetTop={offsetTop} offsetBottom={10}> {children}
{children} </StickyBox>
</StickyBox> );
);
};
export { Sticky }; export { Sticky };

View file

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

View file

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