Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

react keydown event listener

const EscapeListen = React.createClass({
  handleKeyDown: function(e) {
    if (e.keyCode === 27) {
      console.log('You pressed the escape key!')
    }
  },

  render: function() {
    return (
      <input type='text'
             onKeyDown={this.handleKeyDown} />
    )
  }
})
Comment

PREVIOUS NEXT
Code Example
Javascript :: scrapy javascript 
Javascript :: SEQUELIZE OR 
Javascript :: sort object array javascript 
Javascript :: how to add link to button in react js 
Javascript :: toggle state react 
Javascript :: how to filter nested array of objects in javascript 
Javascript :: reverse int js 
Javascript :: clear all intervals js 
Javascript :: javascript check image src 
Javascript :: default value input date js 
Javascript :: import js file into another 
Javascript :: prevent blur event on click 
Javascript :: javascript null true or false 
Javascript :: exponent in javascript 
Javascript :: Fibonacci Recursive in js 
Javascript :: How to loop through an object in JavaScript with a for…in loop 
Javascript :: url params vue 
Javascript :: javascript number between values 
Javascript :: ERESOLVE unable to resolve dependency tree npm ERR npm ERR! Found: @angular/core@5.0.3 npm ERR! node_modules/@angular/core 
Javascript :: javascript change css 
Javascript :: every method javascript 
Javascript :: check if numbers are consecutive javascript 
Javascript :: javascript cancel timeout 
Javascript :: factorial javascript function 
Javascript :: javascript dir 
Javascript :: react fragment 
Javascript :: get form data as object jquery 
Javascript :: object get array of values 
Javascript :: Javascript random password generator Exampe 
Javascript :: how to pass data between components in react 
ADD CONTENT
Topic
Content
Source link
Name
8+8 =