From ea19719b78448a426a52321743399cdb7879857e Mon Sep 17 00:00:00 2001 From: Hyunbin <47051820+hyunbinseo@users.noreply.github.com> Date: Mon, 16 Jan 2023 15:09:30 +0900 Subject: [PATCH 1/2] feat: update dialog example --- .../15-composition/05-modal/App.svelte | 43 ++++--- .../15-composition/05-modal/Modal.svelte | 114 +++++++----------- 2 files changed, 71 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 cfd385644719..f8b99107dc22 100644 --- a/site/content/examples/15-composition/05-modal/App.svelte +++ b/site/content/examples/15-composition/05-modal/App.svelte @@ -1,29 +1,36 @@ - -{#if showModal} - -

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

+ { + showModal = false; + button.focus(); + }} +> +

+ 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 baa57824bc26..b35e83d7f759 100644 --- a/site/content/examples/15-composition/05-modal/Modal.svelte +++ b/site/content/examples/15-composition/05-modal/Modal.svelte @@ -1,81 +1,59 @@ - - - - - + + dialog.close()}> +
+ +
+ +
+ + +
+
\ No newline at end of file + From 5e7219ba2466342c005f1e61ff1acaf7e4a4ae93 Mon Sep 17 00:00:00 2001 From: Simon H <5968653+dummdidumm@users.noreply.github.com> Date: Tue, 21 Feb 2023 12:07:15 +0100 Subject: [PATCH 2/2] button always autofocusses, allows us to simplify --- .../examples/15-composition/05-modal/App.svelte | 11 ++--------- .../examples/15-composition/05-modal/Modal.svelte | 6 +++++- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/site/content/examples/15-composition/05-modal/App.svelte b/site/content/examples/15-composition/05-modal/App.svelte index f8b99107dc22..af93ba39afd8 100644 --- a/site/content/examples/15-composition/05-modal/App.svelte +++ b/site/content/examples/15-composition/05-modal/App.svelte @@ -1,21 +1,14 @@ - - { - showModal = false; - button.focus(); - }} -> +

modal adjective mod·al \ˈmō-dəl\ diff --git a/site/content/examples/15-composition/05-modal/Modal.svelte b/site/content/examples/15-composition/05-modal/Modal.svelte index b35e83d7f759..acdbd50ab11c 100644 --- a/site/content/examples/15-composition/05-modal/Modal.svelte +++ b/site/content/examples/15-composition/05-modal/Modal.svelte @@ -7,7 +7,11 @@ - dialog.close()}> + (showModal = false)} + on:click|self={() => dialog.close()} +>