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.

Search Field: clear field

See original GitHub issue

Related Issues:

#953 - Search Field: disabled state & fits container #952 - Search Field: autosearch & minLength change


Issue Description

New features to add to the search field component:

  • Add programmatic method to clear the search field.

(10/20/2017) Update: generated two new issues to make PR smaller, see Related Issues

Issue Type

  • New Feature
  • Enhancement
  • Bug
  • Other

Expected Behavior

  • items listed above

Current Behavior

  • user click to clear only

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:13 (12 by maintainers)

github_iconTop GitHub Comments

2reactions
bjankordcommented, Oct 20, 2017

Add programmatic method to clear search field. could we add an item here so that we have a programmatic way to set the content of the search field as well

These can be achieved by exposing the value of the input through a value prop similar to the text field. This would make the input a controlled input.

0reactions
Singleton06commented, Nov 20, 2017

Sorry for the late response, @kschuste, I think what you have is more what I was thinking.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How To Clear Input Field on Focus
Click on the input field to clear it: Clear Input Field on Focus. Example. <!-- When the input field gets focus, replace its...
Read more >
HTML | Clearing the input field
To clear the entire input field without having to delete the whole thing manually Or what if there is already a pre-suggested input...
Read more >
Targeting Click of “Clear” Button (X) on Input Field
Everything is working as you expect – you can enter text into the search box, hit enter or the "Search" button, and see...
Read more >
How do I put a clear button inside my HTML text input box ...
Nowadays with HTML5, it's pretty simple: <input type="search" placeholder="Search..."/>. Most modern browsers will automatically render a ...
Read more >
How to Clear Input Fields in JavaScript
To clear input fields in JavaScript, use the onfocus event and target property,onclick event and document.getElementById() method or the reset() method.
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