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

Submitting change with enter refreshes the entire page without saving the change #172

Open
parkdoeui opened this issue Sep 21, 2022 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@parkdoeui
Copy link
Contributor

parkdoeui commented Sep 21, 2022

https://user-images.githubusercontent.com/59836949/191584174-a5a8b3bf-703b-470d-b6cc-6e7b32824394.mov
Seems like the input bar refreshes the page when the input change is made by keyboard. preventDefault() might fix the problem.

@parkdoeui parkdoeui added the bug Something isn't working label Sep 21, 2022
@geoerika
Copy link
Contributor

It doesn't happen on the Widget Studio side though. But I can add this change. Have you tested it yourself?

Screen.Recording.2022-09-26.at.10.08.24.AM.mov

@geoerika
Copy link
Contributor

geoerika commented Sep 26, 2022

@DoParkEQ Textfield component for Title already has a preventDefault() applied:

  <TextField
              autoFocus
              size='lg'
              value={tentativeTitle}
              onChange={(v) => setTentativeTitle(v)}
              onSubmit={(e) => {
                e.nativeEvent.preventDefault()
                e.nativeEvent.stopPropagation()
              }}
              onBlur={(e) => {
                updateTitle(e.target.value)
                setTentativeTitle(title)
                setEditing(false)
              }}
            />

The editor in snoke-dashboard worked perfectly before you changed the entire editing process.

@parkdoeui
Copy link
Contributor Author

parkdoeui commented Sep 29, 2022

Screen.Recording.2022-09-29.at.12.36.27.PM.mov

@geoerika @kc-leung I am quite certain that it is the component issue. Replacing lumen-labs <TextField/> with vanila input does not reproduce page refresh on dashboard side.

Asides from it, since the input element's value update relies on <form>, I don't think this should be a controlled component. Consider defaultValue and take out onChange handler.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants