Skip to content
Open
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
15 changes: 14 additions & 1 deletion docs/reference/actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,25 @@ import { Application, defaultSchema } from "@hotwired/stimulus"

const customSchema = {
...defaultSchema,
keyMappings: { ...defaultSchema.keyMappings, at: "@" },
keyMappings: {
...defaultSchema.keyMappings,
at: "@",
slash: "/",
question: "?"
},
Comment on lines +109 to +114
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO this doesn't add much. The example below could use the existing at mapping.

}

const app = Application.start(document.documentElement, customSchema)
```

Then use them in your action descriptors:

```html
<div data-controller="search"
data-action="keydown.slash->search#focus keydown.question->search#showHelp">
</div>
Comment on lines +123 to +125
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<div data-controller="search"
data-action="keydown.slash->search#focus keydown.question->search#showHelp">
</div>
<div data-controller="mentions"
data-action="keydown.at->mentions#displaySuggestions"></div>

html

If you want to subscribe to a compound filter using a modifier key, you can write it like `ctrl+a`.

```html
Expand Down