-
-
Notifications
You must be signed in to change notification settings - Fork 221
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
bug: Server/Settings/Categories - Empty Category Title exits text input #693
Comments
I believe that this is happening under the /src/pages/settings/server/Categories.tsx At line 334 If this is the case, then it should be possible to prevent the state from changing to saved if null, but allow it if !null |
I believe the issue is in line 375 revite/src/pages/settings/server/Categories.tsx Lines 375 to 392 in a190a51
where the input element goes back to a span if editing (which holds the current category title) is falsy, and an empty string is falsy
|
Changing line 375 from |
Replacing the current revite/src/pages/settings/server/Categories.tsx Lines 345 to 348 in a190a51
with the following: const save = useCallback(() => {
setEditing(undefined);
if (editing !== "") {
setTitle!(editing!);
}
}, [editing, setTitle]); solves the empty string submission issue. an alternative would be: const save = useCallback(() => {
setEditing(undefined);
if (editing) {
setTitle!(editing);
}
}, [editing, setTitle]); but I believe the first one is clearer. Another bug is that entering any category name then switching to edit another category name does
which should be changed to if (editing === undefined) return; |
Closing due to rewrite, marking as potential issue in future by linking to revoltchat/frontend#134. |
What happened?
Issue
Where
https://app.revolt.chat/server//settings/categories
When on Firefox and Edge, Adding Categories text input cancels with an empty string during category creation.
How to recreate
Click the + for a new Category
Erase all text from input
State changes out of editing
--- Version
a190a51 (master)Nightly 0.5.3-7API: 0.5.3-7revolt.js: 6.0.2
Branch
Production (app.revolt.chat)
Commit hash
a190a51
What browsers are you seeing the problem on?
Firefox, Microsoft Edge
Relevant log output
No response
Desktop
PWA
The text was updated successfully, but these errors were encountered: