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

[stable30] fix: use empty template by default when pressing enter #47404

Merged
merged 2 commits into from
Aug 29, 2024
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
4 changes: 4 additions & 0 deletions apps/files/src/components/TemplatePreview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<template>
<li class="template-picker__item">
<input :id="id"
ref="input"
:checked="checked"
type="radio"
class="radio"
Expand Down Expand Up @@ -124,6 +125,9 @@ export default {
onFailure() {
this.failedPreview = true
},
focus() {
this.$refs.input?.focus()
},
},
}
</script>
Expand Down
6 changes: 6 additions & 0 deletions apps/files/src/views/TemplatePicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<!-- Templates list -->
<ul class="templates-picker__list">
<TemplatePreview v-bind="emptyTemplate"
ref="emptyTemplatePreview"
:checked="checked === emptyTemplate.fileid"
@check="onCheck" />

Expand Down Expand Up @@ -179,6 +180,11 @@ export default defineComponent({
// Else, open the picker
this.opened = true
// Set initial focus to the empty template preview
this.$nextTick(() => {
this.$refs.emptyTemplatePreview?.focus()
})
},
/**
Expand Down
2 changes: 0 additions & 2 deletions dist/1218-1218.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/1218-1218.js.map

This file was deleted.

1 change: 0 additions & 1 deletion dist/1218-1218.js.map.license

This file was deleted.

2 changes: 2 additions & 0 deletions dist/3235-3235.js

Large diffs are not rendered by default.

File renamed without changes.
1 change: 1 addition & 0 deletions dist/3235-3235.js.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/3235-3235.js.map.license
4 changes: 2 additions & 2 deletions dist/files-init.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/files-init.js.map

Large diffs are not rendered by default.

Loading