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

feat: ✨ Suppression du clic sur le label et sur le message d'erreur du DsfrFileUpload #997

Closed
wants to merge 1 commit into from
Closed
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
2 changes: 2 additions & 0 deletions src/components/DsfrFileUpload/DsfrFileUpload.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ const acceptTypes = computed(() => {
<label
class="fr-label"
:for="id"
@click.prevent
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ceci ne me semble pas accessible. Pourquoi tu penses que c’est souhaitable ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C'est une remontée de bug chez nous. On voudrait que la fenêtre permettant de sélectionner le/les fichiers soit ouverte uniquement au click sur le input type file (le bouton parcourir). Actuellement la fenêtre s'ouvre aussi au click sur le label de l'input et au click sur le message d'erreur de l'input.

Quel problème cela pose pour l'accessibilité ? J'ai essayé la navigation au clavier et cela fonctionne toujours avec l'ajout des @click.prevent.

Copy link
Collaborator Author

@plegaud plegaud Dec 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Peut être qu'on pourrait conditionner le click.prevent en fonction d'une nouvelle props ?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Je ne vois pas pourquoi ce serait considéré comme un bug. C’est une vraie feature. C’est bien prévu comme cela dans le DSFR, notamment parce que cliquer sur le bouton "parcourir" demande de la précision, et il est, pour certaines personnes, difficile de cliquer exactement sur le bouton parcourir. Je ne le rajouterai donc pas.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK tu as raison, on laisse comme ça.

>
{{ label }}
<span
Expand Down Expand Up @@ -79,6 +80,7 @@ const acceptTypes = computed(() => {
v-if="error || validMessage"
class="fr-messages-group"
role="alert"
@click.prevent
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pourquoi ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Voir commentaire précédent.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ici, en revanche, ce n’est pas normal que cela déclenche l’événement. Et ce n’est pas le cas dans l’exemple du Storybook : https://sb.vue-ds.fr/?path=/story/composants-dsfrfileupload--televersement-avec-erreur

Je serait tenté de penser à une erreur d’imbrication de composant dans votre application.

>
<p
v-if="error"
Expand Down
Loading