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

Focusing on the input after adding category #116

Merged
merged 2 commits into from
Aug 17, 2024
Merged

Conversation

waximabbax
Copy link
Contributor

@waximabbax waximabbax commented Aug 17, 2024

For: #114

It's a little tricky now because of our existing code and also the response we get from our POST request. It sends us the entire page. However, this script should get the job done; we can also put this JS in a separate file, although I don't see the reason to it at the moment. Please do test the code on the UI.

focus.mp4

@waximabbax waximabbax marked this pull request as draft August 17, 2024 02:47
@waximabbax waximabbax changed the title Focusing on the input after adding category Not ready for the review: Focusing on the input after adding category Aug 17, 2024
@waximabbax waximabbax changed the title Not ready for the review: Focusing on the input after adding category Focusing on the input after adding category Aug 17, 2024
@waximabbax waximabbax marked this pull request as ready for review August 17, 2024 03:09
@waximabbax waximabbax force-pushed the focus-on-input branch 3 times, most recently from a46d602 to bcb0570 Compare August 17, 2024 03:15
<form method="POST" action="" class="add-category-form">
<input type="text" name="category" placeholder="New Category" required>
<form method="POST" class="add-category-form">
<input type="text" name="category" placeholder="New Category" id="{{username}}category" required>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Somewhat unrelated question: what happens when username contains a "? Is it escaped?

Copy link
Contributor Author

@waximabbax waximabbax Aug 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works as any other user.

Screenshot from 2024-08-17 23-42-09

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

", not ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JeroenDeDauw " and ' also work fine.

Screenshot from 2024-08-18 12-52-30

@JeroenDeDauw
Copy link
Member

The backend HTML-building approach strikes again!

@waximabbax
Copy link
Contributor Author

The backend HTML-building approach strikes again!

Yeah. I wonder at what point it will force us to create separate Endpoints for POST. However, manipulating HTML with JS is also not very clean, but it is quite straightforward and doesn't require a lot of thinking.

@JeroenDeDauw JeroenDeDauw merged commit feb1baf into master Aug 17, 2024
16 checks passed
@JeroenDeDauw JeroenDeDauw deleted the focus-on-input branch August 17, 2024 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants