Giter VIP home page Giter VIP logo

emoji-picker-textfields-component's People

Contributors

ealush avatar greenkeeper[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

emoji-picker-textfields-component's Issues

Can't render emoticons!

Below is my code, I don't think I am writing it correctly to be able to view emoticons, I get the code of the emoticons inside the textbox such as :happy: and not the icon. Where I am mistaken!!!

`import React, { Component } from 'react'
import {VERIFY_USER} from './Events'
import EmojiField from 'emoji-picker-textfield';

export default class LoginForm extends Component {

constructor(props){
	super(props);
	this.state={
		nickname:"",
		error:""
	};
	this.getUnicode = this.getUnicode.bind(this);
	this.getImages = this.getImages.bind(this);
}

setUser=({user, isUser}) =>{
	console.log(user,isUser)
	if(isUser)
		this.setError("Username taken")
	else{
		this.props.setUser(user)
		this.setError("")
	}
}
componentDidMount(){
	this.getUnicode();
	this.getImages();
}
setError=(error)=>{
	this.setState({error})
}

handleSubmit = (e)=>{
	e.preventDefault()
	const {socket} = this.props
	const {nickname} = this.state
	socket.emit(VERIFY_USER, nickname, this.setUser)
}

handleChange = (e)=>{
	this.setState({nickname:e.target.value})
}

getImages(){
	return this._field.getImages();
}
getUnicode(){
	return this._field.getUnicode();
}
onChange(e, value) {
	document.getElementById('nickname').value =value;
}

render() {
	const { nickname, error } = this.state; 
	return(
		<div>
			<form onSubmit={this.handleSubmit}>
				<label>
					<h2>Got a nickname</h2>
				</label>
				<EmojiField
					id="emoji"
					name="my-input" 
					onChange={this.onChange}
				 	ref={(_field) => {this._field = _field; }}
				 	fieldType="input"
				 />
				<input
					ref={(input)=>{this.textInput = input}}
					type="text"
					name="my-input"
					id="nickname"
					value={nickname}
					onChange={this.handleChange}
					placeholder={"Username"}
				/>
				
				<div className="error">{error ? error:null}</div>
			</form>
			
		</div>
	);
}

}`

please help @ealush

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.