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

[Bug Report][3.4.3] @Click on v-chip in v-file-dialog not working #18638

Open
maxiwolleb opened this issue Nov 9, 2023 · 5 comments · May be fixed by #20250
Open

[Bug Report][3.4.3] @Click on v-chip in v-file-dialog not working #18638

maxiwolleb opened this issue Nov 9, 2023 · 5 comments · May be fixed by #20250
Labels
C: VFileInput good first issue A quick-win fix that would be great for new contributors T: enhancement Functionality that enhances existing features

Comments

@maxiwolleb
Copy link

maxiwolleb commented Nov 9, 2023

Environment

Vuetify Version: 3.4.3
Last working version: 2.7.0
Vue Version: 3.3.8
Browsers: Chrome 119.0.0.0
OS: Windows 10

Steps to reproduce

Generate element with @click in selection slot of v-file-input

https://play.vuetifyjs.com/#eNqVUkFOwzAQ/MrKHJJKNEHAAaGA4MIRIa5tDybdgFXHtmw3FYryd9Z20zYgJDjZHs+Md2e96JmzdfloTNFtkd2yymNrJPd4v1QAVTfnxsRtPNRaeS4U2j0UwUZInAtlth66eavXKO+WLIBuyeDWIl9rJT8JG7dLdpCTwfggnDmUWHuhFXF7CA7PvEUHw0RAkrXo6KlG2/1DgQZCHSXfBKn2D2HgoZai3pAsrlRfLbXjbxJBCrW57/vRYhiqMmn+5HT5f6uqpDZOgygn0SfoNF2CT1J3O+Hrj5PEj+mC5G8Rmszm9Zh+8E36cbShwMlsA5JGP6mLjq62wnhw6LepIdEabT30YLGBARqrW8joN2Xhklydj4NxcBcY+ULhDp4IyBerc8g8Oh+us9lqlhpMkrGdvarh0uGe0GxV/CaUOEWfz6BPXXCJ1udZRDPiAv2cH/TLHDtU/iCKp8J5bV6sNvydB2oe1b84VmWKgJpnwzm7Kq6KGxbW6+KCrb4AB54TAA==

Expected Behavior

trigger click of element inside slot

Actual Behavior

triggers click of v-file-dialog

Reproduction Link

https://play.vuetifyjs.com/#...

@maxiwolleb maxiwolleb changed the title [Bug Report][3.4.0] @Click on elements in v-file-dialog not working [Bug Report][3.4.0] @Click on v-chip in v-file-dialog not working Nov 22, 2023
@maxiwolleb maxiwolleb changed the title [Bug Report][3.4.0] @Click on v-chip in v-file-dialog not working [Bug Report][3.4.3] @Click on v-chip in v-file-dialog not working Nov 22, 2023
@thieleju
Copy link

thieleju commented Dec 13, 2023

Workaround for now:
playground

<v-chip closable link @click:close="() => files.splice(index, 0)">{{fileName}}</v-chip>

<style>
  .v-file-input {
    .v-field__input {
      z-index: 1000001;
    }
    .v-chip__content {
      cursor: initial;
    }
    .chip__close {
      cursor: pointer;
    }
  }
</style>

@github-actions github-actions bot added the S: stale This issue is untriaged and hasn't seen any activity in at least six months. label Jun 14, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jun 29, 2024
@maxiwolleb
Copy link
Author

Maybe reopen since its a bug?

@maxiwolleb
Copy link
Author

@KaelWD Could you please take a look?

@KaelWD KaelWD added T: bug Functionality that does not work as intended/expected C: VFileInput and removed S: triage S: stale This issue is untriaged and hasn't seen any activity in at least six months. labels Jul 29, 2024
@KaelWD KaelWD reopened this Jul 29, 2024
@KaelWD KaelWD added the good first issue A quick-win fix that would be great for new contributors label Jul 29, 2024
@huynhtehoa huynhtehoa linked a pull request Jul 30, 2024 that will close this issue
@klimekszymon
Copy link

klimekszymon commented Aug 21, 2024

@thieleju solution prevent v-file-input from drag and drop file

@J-Sek
Copy link
Contributor

J-Sek commented Nov 15, 2024

Better workaround that does not prevent drag&drop:

.v-file-input {
  .v-field__input {
    z-index: 1;
    pointer-events: none;
    .v-chip {
      pointer-events: all;
    }
  }
}

But it also requires dragging detection in case user drops the file when pointing directly to the chip closing icon.

I don't think it is a bug. None of the example in docs show closable chips. It's just the limitation of current implementation. And actual support for this feature would rather be an enhancement. It could come with remove function from #selection slot binding and possibly slightly more reliable dragging detection.

But assuming, we get it implemented, I worry about actual usability. Misclicking is very easy and opens the system file dialog... annoying... unless we move the invisible <input type='file'> on top of the icon when there is at least one file... but adding new file removes existing chips, because this is how the native input works... The best UX is always a dedicated [Add file] button and a list of chips maintained separately. v-file-input is just a pretty wrapper for the native thing and forcing it to become something more is pointless in my opinion.

@J-Sek J-Sek added T: enhancement Functionality that enhances existing features and removed T: bug Functionality that does not work as intended/expected labels Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: VFileInput good first issue A quick-win fix that would be great for new contributors T: enhancement Functionality that enhances existing features
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants