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

Problem with Complex. #1234

Open
prosvitco-artur opened this issue Jun 4, 2024 · 0 comments
Open

Problem with Complex. #1234

prosvitco-artur opened this issue Jun 4, 2024 · 0 comments

Comments

@prosvitco-artur
Copy link

prosvitco-artur commented Jun 4, 2024

I have found an issue.
When adding new Groups, their IDs are generated using this function.

const ALPHABET = "Uint8ArdomValuesObj012345679BCDEFGHIJKLMNPQRSTWXYZ_cfghkpqvwxyz";
export default function uniqueId() {
	return "cf-${generate(ALPHABET, 21)}";
}

As we can see, the string uses the character '_'.
There is a small probability that this character will appear twice (but the probability exists, and it has happened to me three times in one day, you could say I won the lottery).

What’s the problem, you ask? The problem is that in this function:

handleGroupFieldChange = (fieldId, fieldValue) => {
	const {
		id,
		value,
		onChange
	} = this.props;

	onChange(id, produce(value, (draft) => {
		const path = fieldId.split('__');
		const fieldName = path.pop();
		const group = find(draft, ['_id', path.pop()]);

		set(group, fieldName, fieldValue);
	}));
}

the string is split using '__', and in my case, these fields are not being saved. Therefore, please remove the '_' from the ID generation string in one of the upcoming updates!

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

No branches or pull requests

1 participant