Skip to content

Conversation

@jrcastro2
Copy link
Contributor

import { FeedbackLabel } from "../forms/FeedbackLabel";

export class SelectField extends Component {
constructor(props) {
Copy link
Contributor

Choose a reason for hiding this comment

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

not sure I understand why we need to add state management for this component, could you explain me?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure! We need to add the options to the state because now they are not static only. On a traditional SelectField you would pass the options before (such as vocabularies) but now for the emails for example we want to allow to add new values on the SelectField, to display these values we need to add them to the options as well alongside to the already default static ones passed, otherwise they will not show in the field itself. And also we need it to update the options as we add new items to it manually.

Copy link
Contributor

Choose a reason for hiding this comment

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

we were already able to add new options in the keyword field (deposit form), can't we use the same component, instead of changing the select? I think Select is specifically done so you can select from an existing list, not to add new ones
It would be better to avoid complex component, and have them handle a single responsibility

* Adds support and default implementation for
  multiple selection
* closes CERNDocumentServer/cds-rdm#628
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 - Enhance e-mail notifications

2 participants