nuxt / ui

A UI Library for Modern Web Apps, powered by Vue & Tailwind CSS.
https://ui.nuxt.com
MIT License
4.08k stars 529 forks source link

Input does not block when loading prop is passed #2669

Open waitstop opened 2 hours ago

waitstop commented 2 hours ago

Environment


Version

v2.19.2

Reproduction

https://stackblitz.com/edit/nuxt-ui-4tuf4n?file=app.vue

Description

The Input component does not block user interaction when the loading prop is passed.

Additionally, this issue is reproducible even on the documentation website. The example provided for the loading prop in the documentation exhibits the same behavior, where the input remains interactive despite being in a loading state

Expected Behavior

When the loading prop is true, the input field should be disabled

Actual Behavior

The input field remains interactive despite the loading prop being passed

Additional context

Logs

waitstop commented 2 hours ago

In the Input component, the loading prop is not taken into account when setting the disabled attribute:

<input
  :disabled="disabled"
  ...
>
...

In contrast, the Button component:

<ULink 
  :disabled="disabled || loading"
  ...
>
...
benjamincanac commented 2 hours ago

This is intended to prevent focus blurring out of the Input when typing for example.

waitstop commented 1 hour ago

This is intended to prevent focus blurring out of the Input when typing for example.

Thank you for your response! However, according to the documentation, the expected behavior for the loading prop is to both show a loading icon and disable the Input.

Use the loading prop to show a loading icon and disable the Input