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

Dropdown showClear not always displayed #875

Closed
majugurci opened this issue May 2, 2019 · 0 comments
Closed

Dropdown showClear not always displayed #875

majugurci opened this issue May 2, 2019 · 0 comments
Assignees
Labels
Type: Bug Issue contains a defect related to a specific component.
Milestone

Comments

@majugurci
Copy link

majugurci commented May 2, 2019

I'm submitting a ...

[x] bug report
[ ] feature request
[ ] support request

Codesandbox Case (Bug Reports)
https://codesandbox.io/s/o7z1jvy069

Current behavior
When dropdown value is 0 or false showClear icon is not displayed.

Expected behavior
Icon should be displayed.

I think the problem is code which decides should it display the icon or not.
this.props.value
This condition must be the problem.

renderClearIcon() {
        if(this.props.value && this.props.showClear && !this.props.disabled) {
            return (
                <i className="p-dropdown-clear-icon pi pi-times" onClick={this.clear}></i>
            );
        }
        else {
            return null;
        }
    }
@cagataycivici cagataycivici self-assigned this May 30, 2019
@cagataycivici cagataycivici added the Type: Bug Issue contains a defect related to a specific component. label May 30, 2019
@cagataycivici cagataycivici added this to the 3.1.4 milestone May 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a defect related to a specific component.
Projects
None yet
Development

No branches or pull requests

2 participants