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

AIQ-5472: Make icon hoverable and clickable #142

Merged
merged 2 commits into from
Sep 30, 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
17 changes: 7 additions & 10 deletions specs/SelectMulti.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,19 @@ import { mount, Wrapper } from '@vue/test-utils'

import SelectMulti from '../src/SelectMulti.vue'

const options = [
{ label: 'Item One', value: 'one' },
{ label: 'Item Two', value: 'two' },
{ label: 'Item Three', value: 'three' }
]

describe('SelectMulti', () => {
let wrapper: Wrapper<Vue>

describe('given simple options', () => {
beforeEach(() => {
// TODO: Share sample data between spec files & Storybook stories
const options = [
{ label: 'Item One', value: 'one' },
{ label: 'Item Two', value: 'two' },
{ label: 'Item Three', value: 'three' }
]


wrapper = mount({
data() {
Expand Down Expand Up @@ -65,11 +67,6 @@ describe('SelectMulti', () => {
})
describe('label functionality', () => {
it('adds the aria-labelledby attribute to the listbox', () => {
const options = [
{ label: 'Item One', value: 'one' },
{ label: 'Item Two', value: 'two' },
{ label: 'Item Three', value: 'three' }
]
wrapper = mount({
data() {
return { selectedOptions: [], options }},
Expand Down
2 changes: 1 addition & 1 deletion src/SelectMulti.vue
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@
</div>
</slot>
</div>
<div class="combo-input-icon-block" :class="{ 'not-clickable': !$slots['input-icon'] }">
<div @click="updateMenuState(true)" class="combo-input-icon-block">
<template v-if="!loading">
<slot name="input-icon">
<svg class="combo-plus-icon" viewBox="0 0 10 10" xmlns="http://www.w3.org/2000/svg" fill="currentColor">
Expand Down
5 changes: 1 addition & 4 deletions src/styles/mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -353,10 +353,7 @@ $spacer: 1.875rem; // 30px
top: 50%;
transform: translate(0, -50%);
right: math.div($spacer, 1.5);

&.not-clickable {
pointer-events: none;
}
cursor: pointer;
}

.combo-plus-icon {
Expand Down
Loading