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

fix : 7223 Clicking Outside Fields domain link email phone Close Them #7804

Merged
merged 2 commits into from
Nov 7, 2024

Conversation

prathameshpatil5181
Copy link
Contributor

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

This pull request addresses an issue where clicking outside certain fields (domain, links, email, phone) did not close them as expected. The main change focuses on improving the click-outside behavior in the MultiItemFieldInput component.

  • Added handleDropdownCloseOutside function in MultiItemFieldInput.tsx to handle click-outside events
  • Modified useListenClickOutside hook usage to incorporate the new click-outside handler
  • Implemented event.stopImmediatePropagation() to prevent unintended event bubbling
  • Ensured consistency with standard behavior of other fields for improved user experience

1 file(s) reviewed, 3 comment(s)
Edit PR Review Bot Settings | Greptile

Comment on lines +67 to +70
const handleDropdownCloseOutside = (event: MouseEvent | TouchEvent) => {
onCancel?.();
event.stopImmediatePropagation();
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: Consider adding a check if onCancel exists before calling it

useListenClickOutside({
refs: [containerRef],
callback: handleDropdownClose,
callback: handleDropdownCloseOutside,
});

useScopedHotkeys(Key.Escape, handleDropdownClose, hotkeyScope);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: Consider moving this line after the state declarations for better organization

@prathameshpatil5181
Copy link
Contributor Author

@Bonapara could you please review this request??

@Bonapara
Copy link
Member

LGTM from a product point of view! Thanks @prathameshpatil5181. Over to the tech team for their review.

@charlesBochet
Copy link
Member

/award 100

Copy link

oss-gg bot commented Oct 31, 2024

Awarding prathameshpatil5181: 100 points 🕹️ Well done! Check out your new contribution on oss.gg/prathameshpatil5181

@lucasbordeau
Copy link
Contributor

@charlesBochet @Bonapara I'll review it as this behavior can be tricky and can easily cause regression.

@lucasbordeau lucasbordeau self-requested a review November 4, 2024 11:27
@lucasbordeau lucasbordeau enabled auto-merge (squash) November 6, 2024 13:37
@lucasbordeau lucasbordeau merged commit 3be3065 into twentyhq:main Nov 7, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Clicking Outside Fields Should Close Them
4 participants