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

Remove tabbable form tooltip #1301

Merged
merged 1 commit into from
Sep 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
105 changes: 53 additions & 52 deletions lib/Comment/CommentForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,59 +117,59 @@ function CommentForm({
<form onSubmit={handleSubmitWithLoader} className="comment-edit-form">
<div className={inputWrapperClassNames} ref={inputWrapperRef}>
<MentionsInput
className="edit-comment"
value={commentText}
onChange={handleChange}
onFocus={() => setHasFocus(true)}
onBlur={() => setHasFocus(false)}
placeholder={placeholder}
markup="@[__display__]"
autoFocus={autoFocusInput}
displayTransform={(id: any, display: any) => `@${display}`}
disabled={isSubmitting}
>
<Mention
trigger="@"
onAdd={onMention}
data={(search: any) => searchForUsers(search)}
appendSpaceOnAdd
renderSuggestion={(suggestion: any) => (
<Avatar url={suggestion.avatar} initials={suggestion.initials}>
<AvatarInformation
email={`@${suggestion.display}`}
name={suggestion.name}
/>
</Avatar>
)}
/>
</MentionsInput>

<ShortcutTrigger
shortcutKey="Enter"
onShortcutTrigger={(e: any) => {
if (!hasFocus || !commentText) {
return e;
}
// @ts-expect-error
return handleSubmitWithLoader(e);
}}
withCtrlKey
/>
<ShortcutTrigger
shortcutKey="Enter"
onShortcutTrigger={(e: any) => {
if (!hasFocus || !commentText) {
return e;
}
// @ts-expect-error
return handleSubmitWithLoader(e);
}}
withMetaKey
/>
<ShortcutTrigger
shortcutKey="Escape"
onShortcutTrigger={handleCancel}
className="edit-comment"
value={commentText}
onChange={handleChange}
onFocus={() => setHasFocus(true)}
onBlur={() => setHasFocus(false)}
placeholder={placeholder}
markup="@[__display__]"
autoFocus={autoFocusInput}
displayTransform={(id: any, display: any) => `@${display}`}
disabled={isSubmitting}
>
<Mention
trigger="@"
onAdd={onMention}
data={(search: any) => searchForUsers(search)}
appendSpaceOnAdd
renderSuggestion={(suggestion: any) => (
<Avatar url={suggestion.avatar} initials={suggestion.initials}>
<AvatarInformation
email={`@${suggestion.display}`}
name={suggestion.name}
/>
</Avatar>
)}
/>
</MentionsInput>

<ShortcutTrigger
shortcutKey="Enter"
onShortcutTrigger={(e: any) => {
if (!hasFocus || !commentText) {
return e;
}
// @ts-expect-error
return handleSubmitWithLoader(e);
}}
withCtrlKey
/>
<ShortcutTrigger
shortcutKey="Enter"
onShortcutTrigger={(e: any) => {
if (!hasFocus || !commentText) {
return e;
}
// @ts-expect-error
return handleSubmitWithLoader(e);
}}
withMetaKey
/>
<ShortcutTrigger
shortcutKey="Escape"
onShortcutTrigger={handleCancel}
/>
</div>

{hasFailed && (
Expand All @@ -191,6 +191,7 @@ function CommentForm({
id="submit-conversation-button"
tooltipText={submitTooltipText}
placement="bottom"
tabbable="false"
>
<ButtonPrimary
disabled={!commentText}
Expand Down
Loading