question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Clear method disabling new search action

See original GitHub issue

Version

1.1.0

Steps to reproduce

<AsyncTypeahead
    options={this.props.communesOrPays}
    onChange={function(e) {
        this.props.onCommuneOrPaysUpdate(e);
        //$('#communeorpays-reset').click();
        //this.inputElement.click();
        if (e.length) {
            /**
             * @property {Typeahead} typeaheadC
             */
            this.refs.typeaheadC.getInstance().clear();
        }
    }.bind(this)}
    onSearch={this.props.searchCommuneOrPays}
    labelKey={this.props.formatCommuneOrPaysLabel}
    disabled={!this.props.personnePhysique.pphDateNaissance}
    ref="typeaheadC"
/>
{/* Can"t reset typeahead without disabling search?!!! */}
{/*<button*/}
    {/*id="communeorpays-reset"*/}
    {/*//ref={function(input) {this.inputElement = input;}.bind(this)}*/}
    {/*className="hidden"*/}
    {/*onClick={function() {this.refs.typeahead.getInstance().clear();}.bind(this)}>*/}
    {/*&nbsp;*/}
{/*</button>*/}

Expected Behavior

first search, selection and then click on an item. Input is cleared then when entering new search is triggered. Tried with a hard-coded button, works when user clicks on it but not when programmaticaly clicked (cf code ex)

Actual Behavior

first search works well, selection and then click on an item. Input is cleared but then when entering new search no request/search is triggered.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Sailiascommented, Sep 21, 2017

@BillOTei I have noticed that if you do setTimeout(() => this.refs.typeahead.getInstance().clear(), 0); it works

0reactions
ericgiocommented, Oct 30, 2017

This is fixed in v2.0.0-rc.1

Read more comments on GitHub >

github_iconTop Results From Across the Web

Modify or disable search actions available for contextual search
Search actions can be modified and disabled but not deleted and new actions cannot be created. Procedure. Navigate to All > Contextual ...
Read more >
Manage & delete your Search history - Android - Google Support
Delete Search history saved to your Google Account. Manage Search settings like what activity Google saves and when Google auto-deletes your history.
Read more >
Turn delete object and action query confirmation messages on ...
Turn off object deletion confirmation messages · On the File tab, click Options. · On the left side of the Access Options dialog...
Read more >
Admin actions - Django documentation
If you need to disable a site-wide action you can call AdminSite.disable_action() . For example, you can use this method to remove the...
Read more >
Support - Clear
Get answers to all of your CLEAR questions on enrollment, membership, locations, TSA Precheck, and more.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found