Fork me on GitHub
#re-frame
<
2019-04-04
>
steveb8n03:04:30

Q: what’s the go-to for an auto-complete/typeahead in re-frame? I’m testing Google Closure goog.ui.ac.AutoComplete and NPM https://github.com/JedWatson/react-select (because I’m using shadow) but wondering if I’m missing another good/better option

mikerod04:04:02

@steveb8n react-select here

steveb8n04:04:51

that gives me confidence 🙂

mikerod04:04:14

It seems to have a lot of features and a lot of ability to be extended. It did have a pretty ground-up rewrite in to bring it to it’s current version. I have migrated from the old to the new and think it’s reasonable still.

mikerod04:04:55

It seemed to be about the best I could find when I was looking around. Seems like quite an active project.

steveb8n04:04:24

I’m having the same experience now. learning the 2.4 interop. I’m glad I only do this once

steveb8n06:04:38

got it working now. new version is really clean

mikerod13:04:00

Yeah. I think the new version is an improvement. It seems to be a well thought out API.

steveb8n10:04:27

Found one issue with it. On-change handlers get the value instead of the underlying js event. I can see why but it breaks when used with other libs that's expect events. I had to add a fake "target" to the options to make it work with the free-form lib

mkvlr08:04:53

should re-frame-10x work with modules? I’m seeing errors with 10x in the stacktrace and they appear before cljs_base has been loaded…

mkvlr09:04:23

oh, I guess it’s a more general problem, I missed the hint about modules only being supported with optimizations #{:simple :advanced}

djanus10:04:01

Modules should work with any optimization settings in recent cljs versions, and we at Workshub are using re-frame-10x successfully with them

mkvlr11:04:31

@dj942 right, turns out clearing the output folder fixed my issue… caching things.

ag21:04:10

hey friends, I need to figure out “jump to next input on Enter” thing, does anyone know how to get next-sibling with reagent/re-frame?

ag21:04:24

in on-key-up event

ag21:04:07

oh.. I guess my problem is because we’re using material-ui, I have to go .target.parentElement.parentElement.parentElement.parentElement.nextSibling and that gives me a container where input may or may not be located.

ag21:04:52

is there easy way to search DOM from where you are for the next input element with the tab index +1 of current input?

ag22:04:46

(defn- find-next-tab-stop
  "finds next DOM element in the tabindex chain"
  [el]
  (let [universe (js/document.querySelectorAll "input, button, select, textarea, a[href]")
        list (js/Array.prototype.filter.call universe #(<= 0 (.-tabIndex %)))
        idx (.indexOf list el)]
    (get list (+ 1 idx) (get list 0))))