Fix tag select breaking layout

This commit is contained in:
WithoutPants 2024-09-23 10:28:43 +10:00
parent 82f4a8f671
commit a20fbe33c0
2 changed files with 10 additions and 15 deletions

View file

@ -54,13 +54,13 @@ function sortTagsByRelevance(input: string, tags: FindTagsResult) {
const tagSelectSort = PatchFunction("TagSelect.sort", sortTagsByRelevance);
const _TagSelect: React.FC<
IFilterProps &
IFilterValueProps<Tag> & {
hoverPlacement?: Placement;
excludeIds?: string[];
}
> = (props) => {
export type TagSelectProps = IFilterProps &
IFilterValueProps<Tag> & {
hoverPlacement?: Placement;
excludeIds?: string[];
};
const _TagSelect: React.FC<TagSelectProps> = (props) => {
const [createTag] = useTagCreate();
const { configuration } = React.useContext(ConfigurationContext);

View file

@ -1,7 +1,7 @@
import * as GQL from "src/core/generated-graphql";
import { useTagCreate } from "src/core/StashService";
import { useEffect, useState } from "react";
import { Tag, TagSelect } from "src/components/Tags/TagSelect";
import { Tag, TagSelect, TagSelectProps } from "src/components/Tags/TagSelect";
import { useToast } from "src/hooks/Toast";
import { useIntl } from "react-intl";
import { Badge, Button } from "react-bootstrap";
@ -125,15 +125,10 @@ export function useTagsEdit(
return ret;
}
function tagsControl() {
function tagsControl(props?: TagSelectProps) {
return (
<>
<TagSelect
menuPortalTarget={document.body}
isMulti
onSelect={onSetTags}
values={tags}
/>
<TagSelect isMulti onSelect={onSetTags} values={tags} {...props} />
{renderNewTags()}
</>
);