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

Input example does not show alert #105

Open
ptmkenny opened this issue Aug 4, 2024 · 0 comments
Open

Input example does not show alert #105

ptmkenny opened this issue Aug 4, 2024 · 0 comments

Comments

@ptmkenny
Copy link
Contributor

ptmkenny commented Aug 4, 2024

How to reproduce

  1. Go to https://ionic-svelte.firebaseapp.com/components/Inputs.
  2. Fill out a first and last name and submit the form.
  3. No alert is shown.

Problem

The code for Input/+page.svelte is supposed to show an alert, but this is in a submit() function that never gets called:

	function submit() {
		if (!$errors) {
			const controller = alertController
				.create({
					header: 'Account Created',
					message: `Created account for: <b>${$form.firstName} ${$form.firstName}</b>`,
					buttons: [
						{
							text: 'OK'
						}
					]
				})
				.then((alert) => alert.present());
		}

		if ($errors) {
			const controller = alertController
				.create({
					header: 'Account Not Created',
					message: `There were some errors - see console.log`,
					buttons: [
						{
							text: 'OK'
						}
					]
				})
				.then((alert) => alert.present());
		}
	}

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

No branches or pull requests

1 participant