sagalbot / vue-select

Everything you wish the HTML <select> element could do, wrapped up into a lightweight, extensible Vue component.
https://vue-select.org
MIT License
4.62k stars 1.33k forks source link

Disabled Property dysfunctional in V4.0.0-beta.5 #1702

Closed ManuelTS closed 1 year ago

ManuelTS commented 1 year ago

Describe the bug Disabled is not working, the component remains fully functional when the disabled prop is set to false.

Steps To Reproduce I imported and set the VSelect as follows:

// ...
import vSelect from 'vue-select';
import CloseIcon from '@/components/CloseIcon.vue';
import CaretDownIcon from '@/components/CaretDownIcon.vue';

vSelect.props.components.default = () => ({
  Deselect: CloseIcon, // CloseIcon and CaretDownIcon are vue components with svg inside of them
  OpenIndicator: CaretDownIcon
});

const app = createApp(App)
  .use(createPinia())
  .use(instrumentation)
  .use(initRouter())
  .use(i18n)
  .use(PrimeVue, {
    locale: messages.de.primevue
  })
  .use(ToastService)
  .use(ConfirmationService);
app.mount('body');
app.component('VSelect', vSelect);

and in my SFC I just do:

    <VSelect
      label="value"
      :options="getTechnicianOptions()"
      :disabled="false"
      :placeholder="$t('action.choose')"
      @option:selected="technicianSelection($event, index)"
    ></VSelect>

in the template and I have

import 'vue-select/dist/vue-select.css';

in the scripts file. The getTechnicianOptions() just gives entries, nothing more.

Expected behavior When disabled is set to false:

SaschaMendel commented 1 year ago

I think you might have gotten it backwards (maybe i am missing something) you want disabled to be true to disable the component