I am trying to customize the Material UI Autocomplete and show a count of options that are currently shown in a Popper menu after a user searches and enters a string in the search box (this is before you select an option and it becomes a value which is easy to get a count of with value.length). I may be missing the prop in order to grab the number of options showing out of the entire option array when a user enters a keystroke in the <Textfield/> of the renderInput prop in the <Autocomplete/>.
Here is the code:
<Autocomplete
value={value}
onClose={handleClose}
onChange={(event, newValue) => {
setValue(newValue);
}}
options={options}
getOptionLabel={option => option.title}
renderInput={params => (
<React.Fragment>
<TextField
{...params}
variant="underlined"
placeholder="Search"
/>
<span className={classes.visibleFilterNum}>
Showing X of {options.length}
</span>
</React.Fragment>
)}
/>
Here is the component so far, need to get a constantly updated count for the showing X of total number of options
Here is a codepen of something similar pulled from Material UI example docs for a better example of the starting set of code
