Skip to content

Commit

Permalink
sanitised id
Browse files Browse the repository at this point in the history
  • Loading branch information
JL0000 committed Dec 9, 2024
1 parent 12bb29f commit b5c7529
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/renderer/components/ft-input-tags/ft-input-tags.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { defineComponent } from 'vue'
import FtInput from '../ft-input/ft-input.vue'
import { showToast } from '../../helpers/utils'
import { sanitizeForHtmlId } from '../../helpers/accessibility'

export default defineComponent({
name: 'FtInputTags',
Expand Down Expand Up @@ -58,6 +59,11 @@ export default defineComponent({
}
},
emits: ['already-exists', 'change', 'error-find-tag-info', 'invalid-name', 'toggle-show-tags'],
computed: {
sanitizedId: function() {
return sanitizeForHtmlId(`checkbox-${this.label}`)
},
},
methods: {
updateTags: async function (text, _e) {
if (this.areChannelTags) {
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/components/ft-input-tags/ft-input-tags.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@
class="checkbox-container"
>
<input
:id="label"
:id="sanitizedId"
type="checkbox"
:checked="showTags"
@change="toggleShowTags"
>
<label :for="label">
<label :for="sanitizedId">
{{ $t('Settings.Distraction Free Settings.Show Added Items') }}
</label>
</div>
Expand Down

0 comments on commit b5c7529

Please sign in to comment.