-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #218 from appwrite/refactor-event-modal
Refactor Event Modal
- Loading branch information
Showing
10 changed files
with
627 additions
and
352 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import type { Action } from 'svelte/action'; | ||
|
||
type Props = { | ||
onChange: (selectionStart: number) => void; | ||
}; | ||
|
||
export const selectionStart: Action<HTMLInputElement, Props> = (node, { onChange }) => { | ||
const handler = () => { | ||
onChange(node.selectionStart); | ||
}; | ||
node.addEventListener('click', handler); | ||
node.addEventListener('keydown', handler); | ||
node.addEventListener('keyup', handler); | ||
|
||
return { | ||
update({ onChange }) { | ||
const handler = () => { | ||
onChange(node.selectionStart); | ||
}; | ||
node.addEventListener('click', handler); | ||
node.addEventListener('keydown', handler); | ||
node.addEventListener('keyup', handler); | ||
}, | ||
destroy() { | ||
onChange(-1); | ||
} | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
cbe9055
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
console – ./
console-appwrite.vercel.app
console-git-main-appwrite.vercel.app
demo.appwriters.com
svelte-console.vercel.app
brand-new-console.torsten.appwrite.org