Skip to content

Releases: metonym/svelte-focus-key

v1.0.0

24 Jun 19:03
Compare
Choose a tag to compare
  • support combination of keys (e.g., key="Meta+k") (4d59ee3)
  • use strict equality check for element to focus (4d59ee3)

Combo keys should be delimited by a + symbol.

<script>
  import FocusKey from "svelte-focus-key";

  let element;
</script>

<input bind:this={element} placeholder={'Press "⌘+k" to focus'} />

<FocusKey {element} key="Meta+k" />

v0.3.2

12 Feb 00:22
Compare
Choose a tag to compare
  • publish the built package folder

v0.3.1

08 Feb 01:14
Compare
Choose a tag to compare
  • focusKey action should reflect updated actions
<script>
  import { focusKey } from "svelte-focus-key";

  let selectText = false;
  let key = "k";
  let value = "text";
</script>

<input
  use:focusKey={{ key, selectText }}
  placeholder={'Press "k" to focus'}
  bind:value
/>

<button
  on:click={() => {
    key = key === "/" ? "k" : "/";
    selectText = !selectText;
  }}
>
  Update options
</button>

v0.3.0

25 Jan 04:13
Compare
Choose a tag to compare
  • support multiple keys (key props accepts a string or string[])

    <script>
      import FocusKey from "svelte-focus-key";
    
      let element;
    </script>
    
    <input bind:this={element} placeholder={'Press "a" or "b"'} />
    
    <FocusKey element={element} key={["a", "b"]} />

v0.2.4

15 Dec 16:58
Compare
Choose a tag to compare
  • set type="module" in package.json

v0.2.3

14 Dec 23:56
Compare
Choose a tag to compare
  • remove exports field

v0.2.2

14 Dec 23:51
Compare
Choose a tag to compare
  • do not use subpath exports for exports field

v0.2.1

14 Dec 22:53
Compare
Choose a tag to compare
  • specify exports.import entry in package.json

v0.2.0

30 Nov 16:10
Compare
Choose a tag to compare
  • add selectText prop to select element text when focusing (d7743bb, #1)

Full Changelog: v0.1.1...v0.2.0

v0.1.1

31 Oct 18:28
Compare
Choose a tag to compare
  • remove update key from focus-key.d.ts

Full Changelog: v0.1.0...v0.1.1