Skip to content
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 CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 2.1.3

- Fix `language` prop being ignored unless `autodetect` is explicitly set to `false` (#41)

## 2.1.2

- Default to `tabindex="0"` on the internal `<code>` element to allow keyboard scrolling when a scrollbar is applied to the element. This resolves an accessibility issue found by Vue-Axe. (#33)
Expand Down
2 changes: 1 addition & 1 deletion src/vue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const component = defineComponent({
language.value = newLanguage
})

const autodetect = computed(() => props.autodetect || !language.value)
const autodetect = computed(() => props.autodetect && !language.value)
const cannotDetectLanguage = computed(() => !autodetect.value && !hljs.getLanguage(language.value))

const className = computed((): string => {
Expand Down