Skip to content

[stable8] refactor(Focus): migrate directive to Typescript #6914

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

Merged
merged 1 commit into from
May 13, 2025
Merged
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
2 changes: 1 addition & 1 deletion src/components/NcAppSidebar/NcAppSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,7 @@ import NcAppSidebarHeader from '../NcAppSidebarHeader/index.ts'
import NcButton from '../NcButton/index.js'
import NcEmptyContent from '../NcEmptyContent/index.js'
import NcLoadingIcon from '../NcLoadingIcon/index.js'
import Focus from '../../directives/Focus/index.js'
import Focus from '../../directives/Focus/index.ts'
import { useIsSmallMobile } from '../../composables/useIsMobile/index.js'
import GenRandomId from '../../utils/GenRandomId.js'
import { getTrapStack } from '../../utils/focusTrap.ts'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

export const directive = {
inserted(el) {
import type { ObjectDirective } from 'vue'

const directive: ObjectDirective<HTMLElement> = {
inserted(el: HTMLElement) {
el.focus()
},
}
Expand Down
2 changes: 1 addition & 1 deletion src/directives/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

export { default as Focus } from './Focus/index.js'
export { default as Focus } from './Focus/index.ts'
export { default as Linkify } from './Linkify/index.js'
export { default as Tooltip } from './Tooltip/index.js'
2 changes: 1 addition & 1 deletion styleguide/global.requires.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { isA11yActivation } from '../src/functions/a11y/index.ts'
import { EmojiSkinTone, emojiSearch, emojiAddRecent, getCurrentSkinTone, setCurrentSkinTone } from '../src/functions/emoji/index.ts'
import usernameToColor from '../src/functions/usernameToColor/index.js'
import Tooltip from './../src/directives/Tooltip/index.js'
import Focus from './../src/directives/Focus/index.js'
import Focus from './../src/directives/Focus/index.ts'
import Linkify from './../src/directives/Linkify/index.js'
import { useIsDarkTheme } from '../src/composables/index.js'
import { spawnDialog } from '../src/functions/dialog/index.ts'
Expand Down
Loading