summaryrefslogtreecommitdiffstats
path: root/src/components/LeftSidebar/SearchBox/SearchBox.vue
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2022-07-11 12:23:26 +0200
committerJoas Schilling <coding@schilljs.com>2022-07-11 12:23:26 +0200
commitcc29fafce1c610e14966e0d80470befb5df77fcf (patch)
tree8b263c5411fd4777826be68ced60546726f788ad /src/components/LeftSidebar/SearchBox/SearchBox.vue
parentb28862948a100be972641059f86fc65d6f7b4dcd (diff)
Add aria labels to "Remove input" buttons
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'src/components/LeftSidebar/SearchBox/SearchBox.vue')
-rw-r--r--src/components/LeftSidebar/SearchBox/SearchBox.vue30
1 files changed, 23 insertions, 7 deletions
diff --git a/src/components/LeftSidebar/SearchBox/SearchBox.vue b/src/components/LeftSidebar/SearchBox/SearchBox.vue
index eb173e369..e637402a8 100644
--- a/src/components/LeftSidebar/SearchBox/SearchBox.vue
+++ b/src/components/LeftSidebar/SearchBox/SearchBox.vue
@@ -28,17 +28,31 @@
type="text"
:placeHolder="placeholderText"
@keypress.enter.prevent="handleSubmit">
- <button v-if="isSearching"
- class="abort-search icon-close"
- @click.prevent="abortSearch" />
+ <Button v-if="isSearching"
+ class="abort-search"
+ type="tertiary-no-background"
+ :aria-label="cancelSearchLabel"
+ @click="abortSearch">
+ <template #icon>
+ <Close decorative
+ title=""
+ :size="20" />
+ </template>
+ </Button>
</form>
</template>
<script>
+import Button from '@nextcloud/vue/dist/Components/Button'
+import Close from 'vue-material-design-icons/Close.vue'
import { EventBus } from '../../../services/EventBus.js'
export default {
name: 'SearchBox',
+ components: {
+ Button,
+ Close,
+ },
props: {
/**
* The placeholder for the input field
@@ -68,6 +82,11 @@ export default {
localValue: '',
}
},
+ computed: {
+ cancelSearchLabel() {
+ return t('spreed', 'Cancel search')
+ },
+ },
watch: {
localValue(localValue) {
this.$emit('update:value', localValue)
@@ -136,10 +155,7 @@ export default {
}
.abort-search {
- margin-left: -34px;
- z-index: 1;
- border: none;
- background-color: transparent
+ margin-left: -44px;
}
</style>