Skip to content

Update code snippets to use the platform - #331

Merged
amrbashir merged 2 commits into
tauri-apps:devfrom
TejasQ:dev
Feb 13, 2023
Merged

Update code snippets to use the platform#331
amrbashir merged 2 commits into
tauri-apps:devfrom
TejasQ:dev

Conversation

@TejasQ

@TejasQ TejasQ commented Feb 13, 2023

Copy link
Copy Markdown
Contributor

Why

Currently, the default greeter Tauri app when using the quickstart does not ship a valid HTML form. This is evidenced by nothing happening when pressing "Enter" after typing a name in the name input field:

image

This PR uses proper HTML form elements and their onsubmit handler to have the greeter actually submit a form on Enter, instead of a button receiving a click event only in isolation. I feel this is important as it teaches newcomers stuff and we want to teach them the right stuff.

Caveat

This PR doesn't touch the yew template because I don't know Rust and I'm not sure how to e.preventDefault in an onsubmit handler with Yew. We can treat Yew separately in #332.

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Docs
  • New Binding issue #___
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change?

  • Yes, and the changes were approved in issue #___
  • No

Checklist

  • When resolving issues, they are referenced in the PR's title (e.g fix: remove a typo, closes #___, #___)
  • A change file is added if any packages will require a version bump due to this PR per the instructions in the readme.
  • I have added a convincing reason for adding this feature, if necessary

Other information

@amrbashir amrbashir left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks! I will handle yew in another commit.

@amrbashir
amrbashir merged commit da75790 into tauri-apps:dev Feb 13, 2023
@amrbashir amrbashir mentioned this pull request Feb 13, 2023
10 tasks
amrbashir pushed a commit that referenced this pull request Feb 13, 2023
* Update code snippets to use the platform

* Add change
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.

2 participants