feat: add haptic feedback to all action buttons

This commit is contained in:
benonymity
2022-12-08 00:28:28 -05:00
parent 96dde8cf31
commit 1aa6a441f3
16 changed files with 113 additions and 42 deletions
+7 -3
View File
@@ -48,6 +48,8 @@
</template>
<script>
import { Haptics, ImpactStyle } from '@capacitor/haptics';
export default {
props: {
value: Boolean,
@@ -196,7 +198,8 @@ export default {
}
},
methods: {
clearSelected() {
async clearSelected() {
await Haptics.impact({ style: ImpactStyle.Medium });
this.selected = 'all'
this.show = false
this.$nextTick(() => this.$emit('change', 'all'))
@@ -204,7 +207,7 @@ export default {
clickedSublistOption(item) {
this.clickedOption({ value: `${this.sublist}.${item}` })
},
clickedOption(option) {
async clickedOption(option) {
if (option.sublist) {
this.sublist = option.value
return
@@ -215,6 +218,7 @@ export default {
this.show = false
return
}
await Haptics.impact({ style: ImpactStyle.Medium });
this.selected = val
this.show = false
this.$nextTick(() => this.$emit('change', val))
@@ -228,4 +232,4 @@ export default {
.filter-modal-wrapper {
max-height: calc(100% - 320px);
}
</style>
</style>