(props)
| 96 | } |
| 97 | |
| 98 | function ListBox(props) { |
| 99 | let ref = React.useRef(undefined); |
| 100 | let {listBoxRef = ref, state} = props; |
| 101 | let {listBoxProps} = useListBox(props, state, listBoxRef); |
| 102 | |
| 103 | return ( |
| 104 | <ul |
| 105 | {...listBoxProps} |
| 106 | ref={listBoxRef} |
| 107 | style={{ |
| 108 | margin: 0, |
| 109 | padding: 0, |
| 110 | listStyle: 'none', |
| 111 | maxHeight: '150px', |
| 112 | overflow: 'auto' |
| 113 | }}> |
| 114 | {[...state.collection].map(item => ( |
| 115 | <Option key={item.key} item={item} state={state} /> |
| 116 | ))} |
| 117 | </ul> |
| 118 | ); |
| 119 | } |
| 120 | |
| 121 | function Option({item, state}) { |
| 122 | let ref = React.useRef(null); |
nothing calls this directly
no test coverage detected