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

Dropdown component, options rerender #5

Open
cappaul opened this issue Dec 15, 2020 · 1 comment
Open

Dropdown component, options rerender #5

cappaul opened this issue Dec 15, 2020 · 1 comment

Comments

@cappaul
Copy link

cappaul commented Dec 15, 2020

Når man forandrer state til arrayet til options i en dropdown og det tidligere var valgt en option som faller utenfor nåværende array lengde, krasjer komponenten ved at
Dropdown.base.tsx:759 Uncaught TypeError: Cannot read property 'disabled' of undefined at Dropdown.base.tsx:759 at safeRequestAnimationFrame.ts:26

Dette skjer i denne testen

if (this._focusZone.current) { if (selectedIndices && selectedIndices[0] && !this.props.options[selectedIndices[0]].disabled) {

Dette kan trolig fikses slik

if (this._focusZone.current) { if (selectedIndices && selectedIndices[0] && !this.props.options[selectedIndices[0]] && !this.props.options[selectedIndices[0]].disabled) {

@cappaul
Copy link
Author

cappaul commented Dec 15, 2020

Jeg mener det skal være mulig å forandre lengden til options arrayet når man har valgt en option og at dropdown komponenten enten nullstiller seg eller godtar at det optionet ikke eksisterer lenger uten å krasje

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