-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add an expand option for long sequence lists [...] #1699
Comments
I think we should maybe do a couple of different things:
|
As mentioned on Slack it would be nice to use hidden-until-found for all truncation |
React unfortunately doesn't support hidden-until-found, yet: facebook/react#24741
|
Ah, we should be able to hack this with useRef and useEffect though I'd guess (manipulating the raw dom). I can try to make a wrapper component that does that |
Hmm my experiments didn't work. Not sure why, but we can forget about this for now. For the record, my code: import React, { useRef, useEffect, type ReactNode } from 'react';
interface HiddenUntilFoundProps {
hidden: string;
children?: ReactNode;
}
export const HiddenUntilFound: React.FC<HiddenUntilFoundProps> = ({hidden, children}) => {
const elementRef = useRef<HTMLDivElement>(null); // Specify that the ref will be attached to a div element
useEffect(() => {
if (elementRef.current) {
elementRef.current.hidden = hidden;
}
}, [hidden]);
return (
<div ref={elementRef}>
{children}
</div>
);
};
used as e.g. <HiddenUntilFound hidden="until-found">hello</HiddenUntilFound> I can see that the DOM seems to get set up kind of correctly, but it doesn't work in the end. It seems like some more permanent |
As we at times have very long lists of substitutions it would be good to allow users the the option to expand or close the list of all mutations for a sequence.
The text was updated successfully, but these errors were encountered: