Skip to content

Commit

Permalink
fix input bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
olexh committed Mar 12, 2024
1 parent c706fcf commit b1c7c65
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
3 changes: 3 additions & 0 deletions app/(pages)/edit/_components/edit-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ const Component = ({ slug, content_type, content, mode = 'edit' }: Props) => {
{mode === 'edit' && (
<div className="flex w-full flex-col gap-4">
<Turnstile
options={{
refreshExpired: 'manual',
}}
ref={captchaRef}
siteKey="0x4AAAAAAANXs8kaCqjo_FLF"
/>
Expand Down
2 changes: 1 addition & 1 deletion components/comments/ui/comment-input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ const Component = forwardRef(
src={comment.author.avatar}
/>
</Avatar>
<Label>{comment.author.username}</Label>
<Label className="hidden md:block">{comment.author.username}</Label>
<MaterialSymbolsReplyRounded />
</Badge>
) : (
Expand Down
9 changes: 8 additions & 1 deletion components/modals/search-modal/search-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,14 @@ const Component = ({ onClick, type, children }: Props) => {

useEffect(() => {
function handleKeyDown(e: KeyboardEvent) {
if (e.key === '/') {
const _focused = document.activeElement;

const _inputting =
_focused?.tagName.toLowerCase() === 'textarea' ||
_focused?.tagName.toLowerCase() === 'input' ||
_focused?.role === 'textbox';

if (!_inputting && e.key === '/') {
e.preventDefault();
setOpen((prev) => !prev);
}
Expand Down

0 comments on commit b1c7c65

Please sign in to comment.