[GEN-2209]: fix delete button logic in input lists #2186
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request includes several changes to improve the behavior of input components in the
frontend/webapp/reuseable-components
directory. The main focus is on ensuring that the delete button functionality is consistent and that input validation is properly handled.Improvements to input validation and delete button functionality:
frontend/webapp/reuseable-components/input-list/index.tsx
: Added theisEmpty
utility function and modified the logic to disable the delete button when there is only one row and all inputs are empty. TheautoFocus
attribute was also updated to useisEmpty
. [1] [2] [3]frontend/webapp/reuseable-components/input-table/index.tsx
: Included theisEmpty
utility function and updated the logic to disable the delete button under similar conditions as the input list. TheautoFocus
attribute was adjusted accordingly. [1] [2] [3] [4]frontend/webapp/reuseable-components/key-value-input-list/index.tsx
: Integrated theisEmpty
utility function and modified the delete button logic to ensure it is disabled when appropriate. TheautoFocus
andhasError
attributes were also updated to useisEmpty
. [1] [2] [3] [4] [5]