All Projects → vitalyq → react-trigger-change

vitalyq / react-trigger-change

Licence: MIT license
Trigger React's synthetic change events on input, textarea and select elements

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to react-trigger-change

hermes-js
Universal action dispatcher for JavaScript apps
Stars: ✭ 15 (-76.19%)
Mutual labels:  dispatch, event
spa-bus
🔥Tools for multilevel components to pass values in any SPA
Stars: ✭ 15 (-76.19%)
Mutual labels:  event, trigger
pan-cortex-data-lake-python
Python idiomatic SDK for Cortex™ Data Lake.
Stars: ✭ 36 (-42.86%)
Mutual labels:  event
triggerflow
Event-based Orchestration of Serverless Workflows
Stars: ✭ 38 (-39.68%)
Mutual labels:  trigger
Generic-SQL-Audit-Trail
A generic audit trail based on triggers and dynamic SQL.
Stars: ✭ 15 (-76.19%)
Mutual labels:  trigger
happy
Plataforma online para encontrar orfanatos e facilitar visitas. @Rocketseat
Stars: ✭ 24 (-61.9%)
Mutual labels:  event
multibranch-action-triggers-plugin
MultiBranch Actions Trigger Plugin
Stars: ✭ 29 (-53.97%)
Mutual labels:  trigger
click-image-play-youtube-video
Jquery based plugin to help render and play youtube embed videos on an modal/overlay in your web apps. Responsive build.
Stars: ✭ 19 (-69.84%)
Mutual labels:  trigger
sapa
sapa is a library that creates a UI with a simple event system.
Stars: ✭ 65 (+3.17%)
Mutual labels:  event
my-swift-projects
An overview of my most relevant open-source projects on GitHub
Stars: ✭ 261 (+314.29%)
Mutual labels:  event
eudaq
EUDAQ Data Acquisition Framework
Stars: ✭ 22 (-65.08%)
Mutual labels:  trigger
jira-trigger-plugin
Triggers a build when a certain condition is matched in JIRA
Stars: ✭ 112 (+77.78%)
Mutual labels:  trigger
palette-21-frontend
Frontend website for Palette 2021 using React.js
Stars: ✭ 14 (-77.78%)
Mutual labels:  event
ReduxSimple
Simple Stupid Redux Store using Reactive Extensions
Stars: ✭ 119 (+88.89%)
Mutual labels:  dispatch
react-keyevent
An easy-to-use keyboard event react component, Package size less than 3kb
Stars: ✭ 38 (-39.68%)
Mutual labels:  event
silly-android
Android plugins for Java, making core Android APIs easy to use
Stars: ✭ 40 (-36.51%)
Mutual labels:  change
winevt
Windows Event Interactions in Python
Stars: ✭ 59 (-6.35%)
Mutual labels:  event
eventsourcing-go
Event Sourcing + CQRS using Golang Tutorial
Stars: ✭ 75 (+19.05%)
Mutual labels:  event
tor-ip-changer
request new identity every X seconds interval using TOR client
Stars: ✭ 233 (+269.84%)
Mutual labels:  change
UT GameEventSystem
A flexible event system in Unreal Engine 4
Stars: ✭ 33 (-47.62%)
Mutual labels:  event

react-trigger-change Build Status Npm Version

Build Status

Library for triggering React's synthetic change events on input, textarea and select elements.

In production builds of React ReactTestUtils.Simulate doesn't work because of dead code elimination. There is no other built-in way to dispatch synthetic change events.

This module is a hack and is tightly coupled with React's implementation details. Not intended for production use. Useful for end-to-end testing and debugging.

Install

With npm:

npm install react-trigger-change --save-dev

From a CDN:

<script src="https://unpkg.com/react-trigger-change/dist/react-trigger-change.js"></script>

Use

reactTriggerChange(DOMElement);

DOMElement - native DOM element, will be the target of change event.

One way to obtain a DOM element in React is to use ref attribute:

let node;
ReactDOM.render(
  <input
    onChange={() => console.log('changed')}
    ref={(input) => { node = input; }}
  />,
  mountNode
);

reactTriggerChange(node); // 'changed' is logged

Test

Build the browser bundle:

npm install
npm run build

Open test/test.html in the browser.

To test with a different version of React, specify React and ReactDOM URLs in a query string:

?react=https://unpkg.com/[email protected]/umd/react.development.js&dom=https://unpkg.com/[email protected]/umd/react-dom.development.js
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].