Closed musale closed 6 months ago
Thanks for reaching out to us. Please allow us to look into this and we would get back to you shortly.
For respect to the selection not showing, this is by design. When you override the onRender method, you are given the current selected item and can then render selection yourself. This gives you the option to fully custimize it.
As for scrolling, as mentioned in the other issue you created, we have created a bug for this and will update you on it's status there.
@palatter for us to correctly render the mentions with an indicator showing the active element in the list the active parameter needs to be correctly exposed in the typings.
Here we see that there is an active parameter being passed to the onRender method that we are providing https://github.com/Azure/communication-ui-library/blob/db5cfd0a8484c875b57316e0afcebb6b4358aa5e/packages/react-components/src/components/MentionPopover.tsx#L331
But here https://github.com/Azure/communication-ui-library/blob/db5cfd0a8484c875b57316e0afcebb6b4358aa5e/packages/react-components/src/components/MentionPopover.tsx#L88 the active parameter is not exposed and therefore consumers of the library using TypeScript are unaware of the existence of this vital parameter.
@palatter can we get this added to the API? It would be nice to wrap this into the next beta
@musale This was released in the last beta, I'm going to close this issue now that the fix is release.
Describe the bug; what happened? When you set the
mentionLookupOptions
in theSendBox
, the JSX element provided foronRenderSuggestionItem
renders correctly. However, keyboard up/down is not working, the current position of the highlighted suggestion is not shown and the scrolling bar is not showing.What are the steps to reproduce the issue?
SendBox
mentionLookupOptions
to:const suggestions: Mention[] = [ { id: '1', displayText: '' }, { id: '2', displayText: 'Patricia Adams' }, { id: '3', displayText: '1' }, { id: '4', displayText: 'Your user' }, { id: '5', displayText: 'Milton Dyer' }, { id: '6', displayText: 'Ella Stewart' }, { id: '7', displayText: 'Todd Nelson' }, { id: '8', displayText: 'Bertie Holman' }, { id: '9', displayText: 'Chloe Alvarez' }, { id: '10', displayText: 'Hannah Gibson' }, { id: '11', displayText: "Amelia O'Connor" }, { id: '12', displayText: "Amelia O'Connor" }, { id: '13', displayText: 'Imogen Morris' }, { id: '14', displayText: 'Freya Hayes' }, { id: '15', displayText: 'Ellie Collins' }, { id: 'everyone', displayText: 'Everyone' } ]; const trigger = '@';
export const MentionsExample: () => JSX.Element = () => { const timeoutRef = React.useRef();
const delayForSendButton = 300;
useEffect(() => { return () => { timeoutRef.current && clearTimeout(timeoutRef.current); }; }, []);
return (
); };