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

[RFR] Fix AutocompleteInput reopen after selection #2836

Merged
merged 1 commit into from
Jan 31, 2019

Conversation

djhi
Copy link
Contributor

@djhi djhi commented Jan 30, 2019

Fixes #2428

Before:
before

After:
after

@djhi djhi added this to the v2.6.4 milestone Jan 30, 2019
@fzaninotto fzaninotto merged commit b37cec9 into master Jan 31, 2019
@fzaninotto fzaninotto deleted the fix-autocomplete-reopen branch January 31, 2019 13:49
@wmwart
Copy link

wmwart commented Feb 11, 2019

fix still didn't help
chrome-capture

Do optionText = {optionRendererStreet} properties, suggestionComponent = {AddressSuggestionComponent} affect this behavior?

...
<AutocompleteInput optionText={optionRendererStreet} suggestionComponent={AddressSuggestionComponent} shouldRenderSuggestions={(val) => { return val.trim().length > 2 }} inputValueMatcher={() => null} />
...
const optionRendererStreet = choice => {          
    var result = `${choice.typeShort}. ${choice.name}`;
    return result;
};
const AddressSuggestionComponent = withStyles(styles)(({
    suggestion,
    query,
    isHighlighted,
    classes,
    ...props
}) => {
 ...
    return(
        <div className={`${className} ${classes.root}`} {...rest}>  
            <div className={`${classes.flex}`}>
                {getLocationIcon(suggestion.level)}
                <span>
                    <span>{`${suggestion.typeShort}. `}</span>
                    {parts.map((part, index) => {
                    const className = part.highlight ? classes.highlight : null;

                    return (<span className={className} key={index}>{part.text}</span>);
                    })}
                </span>
            </div>
            <Typography variant="caption" noWrap >{getParentsDescription(suggestion.parents)}</Typography>
        </div>
    )
});

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