From 213049cc2e6dfddb872c2286a2a8e5f00c22d73e Mon Sep 17 00:00:00 2001 From: Hyunbin <47051820+hyunbinseo@users.noreply.github.com> Date: Tue, 21 Feb 2023 20:07:33 +0900 Subject: [PATCH] docs: update dialog example (#8200) * feat: update dialog example * button always autofocusses, allows us to simplify --------- Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com> --- .../15-composition/05-modal/App.svelte | 36 +++--- .../15-composition/05-modal/Modal.svelte | 118 ++++++++---------- 2 files changed, 68 insertions(+), 86 deletions(-) diff --git a/site/content/examples/15-composition/05-modal/App.svelte b/site/content/examples/15-composition/05-modal/App.svelte index cfd3856447..af93ba39af 100644 --- a/site/content/examples/15-composition/05-modal/App.svelte +++ b/site/content/examples/15-composition/05-modal/App.svelte @@ -4,26 +4,26 @@ let showModal = false; - -{#if showModal} - -

- modal - adjective mod·al \ˈmō-dəl\ -

+ +

+ modal + adjective mod·al \ˈmō-dəl\ +

-
    -
  1. of or relating to modality in logic
  2. -
  3. containing provisions as to the mode of procedure or the manner of taking effect —used of a contract or legacy
  4. -
  5. of or relating to a musical mode
  6. -
  7. of or relating to structure as opposed to substance
  8. -
  9. of, relating to, or constituting a grammatical form or category characteristically indicating predication
  10. -
  11. of or relating to a statistical mode
  12. -
+
    +
  1. of or relating to modality in logic
  2. +
  3. + containing provisions as to the mode of procedure or the manner of taking effect —used of a contract or legacy +
  4. +
  5. of or relating to a musical mode
  6. +
  7. of or relating to structure as opposed to substance
  8. +
  9. of, relating to, or constituting a grammatical form or category characteristically indicating predication
  10. +
  11. of or relating to a statistical mode
  12. +
- merriam-webster.com -
-{/if} + merriam-webster.com +
diff --git a/site/content/examples/15-composition/05-modal/Modal.svelte b/site/content/examples/15-composition/05-modal/Modal.svelte index baa57824bc..acdbd50ab1 100644 --- a/site/content/examples/15-composition/05-modal/Modal.svelte +++ b/site/content/examples/15-composition/05-modal/Modal.svelte @@ -1,81 +1,63 @@ - - - - - + + (showModal = false)} + on:click|self={() => dialog.close()} +> +
+ +
+ +
+ + +
+
\ No newline at end of file +