Skip to content
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

Delete button remains on screen after leaving element #3072

Closed
AbdBarho opened this issue May 7, 2023 · 3 comments · Fixed by #3201
Closed

Delete button remains on screen after leaving element #3072

AbdBarho opened this issue May 7, 2023 · 3 comments · Fixed by #3201
Assignees
Labels
bug Something isn't working good first issue Good issue for project newcomers UI/UX All website Components website

Comments

@AbdBarho
Copy link
Collaborator

AbdBarho commented May 7, 2023

Happens on /chat and in the subchats if the chat is not active

image

The code for this is here:

{!isEditing && (
<>
<EditChatButton onClick={setIsEditing.on} />
<HideChatButton chatId={chat.id} onHide={onHide} />
{/* we have to stop the event, otherwise it would cause a navigation and close the sidebar on mobile */}
<div onClick={stopEvent}>
<Menu>
<MenuButton>
<ChatListItemIconButton label={t("more_actions")} icon={MoreHorizontal} />
</MenuButton>
<Portal>
{/* higher z-index so that it is displayed over the mobile sidebar */}
<MenuList zIndex="var(--chakra-zIndices-popover)">
<DeleteChatButton chatId={chat.id} onDelete={onDelete} />
</MenuList>
</Portal>
</Menu>
</div>

@AbdBarho AbdBarho added bug Something isn't working website good first issue Good issue for project newcomers UI/UX All website Components labels May 7, 2023
@viju-sharma
Copy link

Hey. Can you please assign it to me?

@Aditya-13
Copy link
Contributor

Hey @AbdBarho , i think the issue is fixed now.

As the code also changed :--

Screenshot from 2023-05-15 12-44-08

can you please check if the issue still persists?

@AbdBarho
Copy link
Collaborator Author

No it is still a problem :/

Aditya-13 pushed a commit to Aditya-13/Open-Assistant that referenced this issue May 20, 2023
@olliestanley olliestanley linked a pull request May 20, 2023 that will close this issue
notmd pushed a commit that referenced this issue May 26, 2023
Fixed Issue #3072.

By adding containerRef prop to the Portal element.


Issue (div will come at the top of the screen as Portal renders outside
the DOM) :--



https://github.com/LAION-AI/Open-Assistant/assets/91950158/2ec0634b-e1ad-4dfd-977f-c84ed682773c


Solution (Making the Portal relative by giving the reference to its
parent div using useRef) :--



https://github.com/LAION-AI/Open-Assistant/assets/91950158/a6146129-bd74-423f-aa6c-f842355c85dc

Co-authored-by: Aditya <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good issue for project newcomers UI/UX All website Components website
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants