Comments (2)
@mike-thompson-day8 This solution took me a couple hours to find. Specifically, I just wanted to create an input box that allows me to fire re-frame/dispatch
on every on-change
, but also to have an :attr {on-key-up (fn [] ...
to fire a different dispatch
when the user hits <enter>
.
Also, it took me another chunk of time to find that :attr
attribute for adding arbitrary attributes.
Just feedback, to make things more useful.
I super love re-frame
and re-com
by the way, thanks for the hard work!
If it helps anyone solving a similar problem, here's a snippet of my code:
[input-text
:model @keywords
:placeholder "search"
:on-change #(re-frame/dispatch [:change-keywords %])
:change-on-blur? false
:attr {:on-key-up (fn [e]
(if (= 13 (.-keyCode e)) ;; `Enter` key
(re-frame/dispatch [:change-search])))}
]
from re-com.
Set :change-on-blur?
to false
.
See demo and explanation: http://re-demo.s3-website-ap-southeast-2.amazonaws.com/#/input-text
from re-com.
Related Issues (20)
- Tour component demo breaks on clicking "Start Tour!" button HOT 1
- Filter issue when using hiccup for labels in multi-select
- Check-box styling is overridden by browser instead of bootstrap HOT 2
- disabled list should not show on hover background HOT 2
- Conflicting documentation in splits HOT 1
- Datepicker header height increases when a disabled next or previous year button is displayed HOT 1
- Missing icons? HOT 1
- Pass event to popover :on-cancel
- status icon :error has incorrect zmdi-spinner in class
- v-table scrollbar thumb colors are hardcoded (potential PR)
- reagent 1.2.0 reagent.dom/dom-node is deprecated HOT 1
- Bizarre issue with the typeahead component HOT 1
- enhancement: Support :enabled? prop on tab components HOT 1
- horizontal-bar-tabs: Suppress redundant on-click handler calls HOT 3
- Unknown parameter: :parts in tree-select
- Re-com won't build with figwheel-main fig:min HOT 4
- v-table reset! on hover? fails in 2.21.0 but ok in 2.19.0
- simple-v-table: rendering issue/breakage in 2.21.3
- recent changes to v-table still has rendering issues in 2.21.4 HOT 1
- Disabled background colour should be grey in single-dropdown
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from re-com.