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

Updated packages and fixed export for the latest svelte-kit #8

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 16 additions & 6 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
module.exports = {
root: true,
parser: "@typescript-eslint/parser",
extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended", "prettier"],
plugins: ["svelte3", "@typescript-eslint"],
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:svelte/recommended",
"prettier",
],
plugins: ["@typescript-eslint"],
ignorePatterns: ["*.cjs"],
overrides: [{ files: ["*.svelte"], processor: "svelte3/svelte3" }],
settings: {
"svelte3/typescript": () => require("typescript"),
},
overrides: [
{
files: ["*.svelte"],
parser: "svelte-eslint-parser",
parserOptions: {
parser: "@typescript-eslint/parser",
},
},
],
parserOptions: {
sourceType: "module",
ecmaVersion: 2019,
Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# :mouse_trap: focus-svelte
# :mouse_trap: focus-svelte

Focus trap for svelte with zero dependencies.

Expand Down Expand Up @@ -28,9 +28,10 @@ is stopped and the elements' properties are reset. If a focus trap later becomes
the observer is restarted and nodes are decorated accordingly.

When a trap becomes active for the first time, the `HTMLElement` that is assigned focus is
determined by the configuration options passed to the component or action.
- If `element` is
assigned and is tabbable, it will be focused upon.
determined by the configuration options passed to the component or action.

- If `element` is
assigned and is tabbable, it will be focused upon.
- If `element` is `undefined` or not tabbable and `focusable` is `true`, the `HTMLElement` with `use:focus` is granted focus.
- If neither of the previous conditions are met, focus will be placed on the first tabbable element.

Expand Down
Loading