by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 12:04

    silviuaavram on more-examples

    add checkbox examples (compare)

  • 05:51
    silviuaavram commented #1053
  • May 26 13:53
    slorber commented #1053
  • May 26 10:50
    m4r35 commented #1018
  • May 25 14:46

    silviuaavram on more-examples

    add window example keep menu open at selection for… (compare)

  • May 25 14:17

    silviuaavram on fix-docsite-link

    (compare)

  • May 25 14:17

    silviuaavram on master

    docs: fix docsite links (#1062) (compare)

  • May 25 14:17
    silviuaavram closed #1062
  • May 25 14:16
    silviuaavram edited #1062
  • May 25 14:15
    silviuaavram opened #1062
  • May 25 14:14

    silviuaavram on fix-docsite-link

    fix links (compare)

  • May 24 05:07
    silviuaavram commented #1061
  • May 24 05:05
    silviuaavram commented #1061
  • May 23 17:15
    yudao closed #1061
  • May 23 17:15
    yudao commented #1061
  • May 23 17:10
    yudao commented #1061
  • May 23 17:09
    yudao commented #1061
  • May 23 14:57
    silviuaavram commented #1061
  • May 23 14:52
    yudao opened #1061
  • May 22 19:46
    ncesar closed #1060
Ferdinand Salis
@ferdinandsalis
👋
Kent C. Dodds
@kentcdodds
:wave: :earth_africa: :earth_americas: :earth_asia:
Ferdinand Salis
@ferdinandsalis
:D
Wojciech Kwolek
@irth
hello Twitch people! :D
Kent C. Dodds
@kentcdodds
~/Developer/downshift (master)
🏎  $ npm publish --tag rc
+ downshift@1.0.0-rc.6
Ferdinand Salis
@ferdinandsalis
Hi there
Mattias Hällkvist
@emattias
Right now when I enter something in the input and click on the document body to close the menu the input gets cleared because reset is called and it sets the inputValue which clears the input: https://github.com/paypal/downshift/blob/master/src/downshift.js#L603 This is because selectedItem is null so inputValue: this.props.itemToString(selectedItem) sets inputValue to empty string. Is there a recommended way to make the input just keep the value instead of reseting everything?
I tried overriding onBlur on my input but then my onChange handler I sent into <Downshift /> isn’t called.. 😬
Pete Redmond
@httpete-ire
With Downshift is it possible that when an item is selected is it possible that navigating the list starts from the selected item. See video for example :point_down:
Kent C. Dodds
@kentcdodds
Yes, that's definitely possible
Pete Redmond
@httpete-ire
that example is using react-select
Kent C. Dodds
@kentcdodds
It might require that you control the highlightedIndex state. I think that's reset to the default when a selection is made
Pete Redmond
@httpete-ire
@kentcdodds Thanks for the quick reply. Thats awesome, I'll give that a go
Kent C. Dodds
@kentcdodds
Good luck!
Pete Redmond
@httpete-ire
@kentcdodds got it working. https://codesandbox.io/s/946x8v0wkr
Any improvements that can be made?
Kent C. Dodds
@kentcdodds
Made a few improvements :+1: https://codesandbox.io/s/j3m89kz885
Looks good otherwise though :)
Pete Redmond
@httpete-ire
@kentcdodds Thanks Kent.
Although changes.hasOwnProperty('highlightedIndex') will set the highlightedIndex to null when an item is selected
Pete Redmond
@httpete-ire
@kentcdodds I have another question regarding managing the highlightedIndex state. I'm getting this weird bug when highlighting items. The div doesnt update the scroll position when scrolling through items (might be easier to look at the example videos)
Pete Redmond
@httpete-ire
https://streamable.com/4uj6g (highlighting bug when managing highlightedIndex state)
https://streamable.com/otuhs (expected behaviour)
Kent C. Dodds
@kentcdodds
Hey @httpete-ire, yeah, that's pretty odd. My guess is that the highlightedIndex is off by one somehow. So when you update the highlightedIndex, it's not re-scrolling things into view. We fixed a bug related to that recently. Are you on the latest version of downshift?
Pete Redmond
@httpete-ire
@kentcdodds Using the latest version. Have created a code sandbox with the issue if that helps
We checked the value of highlightedIndex and it was correct. It seems like Downshift is always one render behind when managing highlightedIndex
Kent C. Dodds
@kentcdodds
Whoops, looks like the fix hasn't been merged yet: paypal/downshift#247
Paul Attard
@pattard
Hello, I am trying to disable one of the items in my menu by not passing getItemProps for the disabled items. I am still able to navigate to it using my keyboard and it also messes up the indexes of the items after any disabled items
Merlijn Vos
@Murderlon
Hi, I'm a bit stuck on returning objects instead of a value for the first parameter of onChange, where does one specify what to return?
Srepfler Srdan
@schrepfler
Howdy, I’d like to create a component which is like the splunk search bar
so for example I’d like to have the capability of loading (or fetching server side) the options for autocompletion
example writing index= should then fetch some data and display a dropdown using downshift and then clicking it would just expan d
in the text box
No need to select anything in particular
would downshift be good for something like that?
Isaac Luxford
@iktl
Hi all – wondering if anyone else has run into this, I'm disabling items through getItemProps and it's correctly preventing them from being selected, however I'm still able to use the keyboard inputs to scroll through and select non-disabled items. I'm likely just missing something obvious...
Garrett Dawson
@killtheliterate
heya folks—anyone have experience implementing an autcomplete with downshift where the ac suggestions are based on cursor position? Think something like a query builder
@schrepfler heh, looks like you’re trying to build something similiar. how’d it go?
Garrett Dawson
@killtheliterate
are there any examples of a multi-word autocomplete using downshift? Where making a selection from the dropdown doesn’t replace the input value, but only the last term/
Cody Lawson
@codylawson
For a button dropdown is it possible to set the highlightedIndex based on the user typing? For example jumping to 'Red' when the user types 'r'
Mikael Midtgaard
@lopno
Hey, what is the easiest way to change the direction of the up and down keys for highlighting items? I tried to use stateReducer, but I can't find much documentation on it.
Fernando Montoya
@montogeek
It seems that when you provide initialSelectedItem, onSelect is not called. I am calling a custom callback in onSelect, but this prop is not called for the initial value
Any workaround?