if the state is not opened the `selectedIndex` is set to `0`. it not necessary.