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

Add new array elements at the top #1102

Open
lordrip opened this issue May 20, 2024 · 4 comments
Open

Add new array elements at the top #1102

lordrip opened this issue May 20, 2024 · 4 comments
Labels
canvas/config-form Configuration form related issues good first issue Good for newcomers help wanted Extra attention is needed ui/ux This issue is about improving the UI / UX

Comments

@lordrip
Copy link
Member

lordrip commented May 20, 2024

Please describe the feature that you want to propose

When adding a new array element, for instance, a new header in the setHeaders processor, it would be better to place the newly created header field at the top.

This needs to be tackled at https://github.com/KaotoIO/uniforms-patternfly side.

Here's where the new item gets concatenated:
https://github.com/KaotoIO/uniforms-patternfly/blob/12b726c10c1b458613850c8de3251324cfafc8b1/src/ListAddField.tsx#L51C42-L51C106

@lordrip lordrip added good first issue Good for newcomers help wanted Extra attention is needed canvas/config-form Configuration form related issues ui/ux This issue is about improving the UI / UX labels May 20, 2024
@apupier
Copy link
Member

apupier commented May 21, 2024

I do not understand why adding at the top. I usually expect that new elements in array are added at the end. Can you clarify in which case it is better to add it at the top/beginning?

@lordrip
Copy link
Member Author

lordrip commented May 21, 2024

Let's say we have the following structure:

Title | Add button

  • Item no. 1
  • Item no. 2
  • Item no. 3

When adding a new element, if it appears at the end, this means scrolling down and up to create a new item, configuring it and then going to the top to add a new one. For instance with setHeaders EIP

@apupier
Copy link
Member

apupier commented May 21, 2024

I would expect a scroll bar for the list of item itself, so that the title and add button are always visible

@lordrip
Copy link
Member Author

lordrip commented May 21, 2024

Another alternative could be to have an "Add new" button at the bottom of the newly created element.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
canvas/config-form Configuration form related issues good first issue Good for newcomers help wanted Extra attention is needed ui/ux This issue is about improving the UI / UX
Projects
Status: Backlog
Development

No branches or pull requests

2 participants