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

fix(select): observable for label change #284

Merged
merged 1 commit into from
Nov 21, 2023
Merged

Conversation

aesteves60
Copy link
Contributor

@aesteves60 aesteves60 commented Nov 16, 2023

Not work juste with childList, test e2e ok but not work on React App without the fix.
I try on a React App :

const App = () => {
    const [list, setList] = useState([
        { value: "1", label: "1" },
        { value: "2", label: "2" },
        { value: "3", label: "3" },
    ])
    
    function update() {
        setList(list.map(item => ({ ...item, label: item.label + 'test'})));
    }
   
    return (
        <div>
            <OsdsSelect>
                { list.map((item) => <OsdsSelectOption key={item.value} value={item.value} >{item.label}</OsdsSelectOption>) }
            </OsdsSelect>

            <button onClick={() => update()}>test</button>
        </div>
    )
}

@aesteves60 aesteves60 requested a review from a team as a code owner November 16, 2023 13:45
@aesteves60 aesteves60 merged commit 272075b into master Nov 21, 2023
@aesteves60 aesteves60 deleted the fix-select-label branch November 24, 2023 15:21
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.

3 participants