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.

Remove fixtures when input has value

See original GitHub issue

Short description

I’m trying to remove the fixtures when the input has value.

Expected results

The fixtures should be removed

Actual results

The fixtures are still there

Additional Information

I saved the input value into the state using onChange method, and I tried the following methods:

const [value, setValue] = useState('');
  1. Using the fixtures prop and the state to filter the fixtures.
<Geosuggest
        fixtures={fixtures.filter(({ label }) => label.loLowerCase().includes(value))}
        onChange={(v) => {
             setValue(v.toLowerCase());
         }}

or

<Geosuggest
        fixtures={value ? null : fixtures)}
        onChange={(v) => {
             setValue(v.toLowerCase());
         }}
  1. Using the skipSuggest prop (as suggested here: https://github.com/ubilabs/react-geosuggest/issues/371) Note: there is no isFixtures property on the skipSuggest parameter, but only the fixtures have label
<Geosuggest
        skipSuggest={({ label }) => !!(value && label)}
        fixtures={fixtures}
        onChange={(v) => {
             setValue(v.toLowerCase());
         }}

I even tried changing maxFixtures base on the value, but it didn’t work.

Is there any solution to this problem ? Or is there something wrong in my code ? Thank you for your time!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
annikabockcommented, Apr 29, 2020

Will be fixed by Ubilabs upcoming week

1reaction
ro-kacommented, May 8, 2020

Ah, thanks! Could reproduce it and fixed it. When the PR went through I’ll publish later today.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular 4 (karma) Test input value to input filed - Stack Overflow
Removing WhenStable() make this happens. it('Test input field value. ', async () => { const divDescription = fixture.
Read more >
A number input will always have left pad 0 though parseFloat ...
I have a number input with defalut value 0 and in onChange function ... behavior is consistent, we can probably remove the manual...
Read more >
Eliminating Fixture Effects from Embedded Measurements
Introduction. It is often necessary to measure a Device Under Test (DUT), which is mounted on a fixture attached to a printed circuit...
Read more >
How to use fixtures — pytest documentation
“Requesting” fixtures¶. At a basic level, test functions request fixtures they require by declaring them as arguments. When pytest goes to run a...
Read more >
Fixture to suppress display of warnings - MATLAB - MathWorks
Create Fixture to Suppress Warnings. Suppress the warning that occurs when you try to remove a folder from the search path that is...
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