fix: + buttons for note creation pass MouseEvent as type, causing crash
onClick={onCreateNote} passes the React MouseEvent as the first arg
to handleCreateNoteImmediate(type?), which treats it as a truthy type
string. generateUntitledName then calls .toLowerCase() on the event
object, throwing a TypeError and silently aborting note creation.
Wrap both NoteList and TabBar onClick handlers to call with no args.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -611,7 +611,7 @@ function NoteListInner({ entries, selection, selectedNote, allContent, modifiedF
|
||||
</button>
|
||||
<button
|
||||
className="flex items-center text-muted-foreground transition-colors hover:text-foreground"
|
||||
onClick={onCreateNote}
|
||||
onClick={() => onCreateNote()}
|
||||
title="Create new note"
|
||||
>
|
||||
<Plus size={16} />
|
||||
|
||||
@@ -183,7 +183,7 @@ export const TabBar = memo(function TabBar({
|
||||
>
|
||||
<button
|
||||
className="flex items-center justify-center border-none bg-transparent p-0 text-muted-foreground cursor-pointer hover:text-foreground transition-colors"
|
||||
onClick={onCreateNote}
|
||||
onClick={() => onCreateNote?.()}
|
||||
title="New note"
|
||||
>
|
||||
<Plus size={16} />
|
||||
|
||||
Reference in New Issue
Block a user