Skip to content

Commit

Permalink
fix: image upload button in markdown editor (#1746)
Browse files Browse the repository at this point in the history
  • Loading branch information
aeharding authored Nov 26, 2024
1 parent d5dab32 commit 308a5f6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,12 @@
display: flex;
align-items: center;
justify-content: center;

cursor: pointer;

/* Image upload button */
label > & {
width: 100%;
height: 100%;
}
}
12 changes: 9 additions & 3 deletions src/features/shared/markdown/editing/modes/DefaultMode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -336,12 +336,18 @@ export default function DefaultMode({

<markdown-toolbar for={TOOLBAR_TARGET_ID}>
<label htmlFor="photo-upload-toolbar">
<button
<div
// Needs to be div for label click propagation
role="button"
aria-label="Upload image"
className={styles.button}
onClick={() => textareaRef.current?.focus()}
onClick={() => {
textareaRef.current?.focus();
return true;
}}
>
<IonIcon icon={image} color="primary" />
</button>
</div>

<input
className="ion-hide"
Expand Down

0 comments on commit 308a5f6

Please sign in to comment.