Add selected state in dropdowns

- Fixes #1363
- Fixes #1056