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:
parent
0a5caf6bda
commit
03ab52f814
3 changed files with 8 additions and 9 deletions
|
@ -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 (
|
||||
const Sticky: FC<IProps> = ({ children, offsetTop = 65 }) => (
|
||||
<StickyBox offsetTop={offsetTop} offsetBottom={10}>
|
||||
{children}
|
||||
</StickyBox>
|
||||
);
|
||||
};
|
||||
);
|
||||
|
||||
export { Sticky };
|
||||
|
|
|
@ -35,6 +35,7 @@ const TagAutocomplete: VFC<TagAutocompleteProps> = ({
|
|||
|
||||
const pop = usePopper(wrapper?.current?.parentElement, wrapper.current, {
|
||||
placement: 'bottom-end',
|
||||
strategy: 'fixed',
|
||||
modifiers: [
|
||||
{
|
||||
name: 'offset',
|
||||
|
|
|
@ -101,8 +101,8 @@ const TagInput: FC<IProps> = ({ exclude, onAppend, onClearTag, onSubmit }) => {
|
|||
|
||||
const onAutocompleteSelect = useCallback(
|
||||
(val: string) => {
|
||||
onAppend([val]);
|
||||
setInput('');
|
||||
onAppend([val]);
|
||||
},
|
||||
[onAppend, setInput]
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue