Giter VIP home page Giter VIP logo

react-input-trigger's People

Contributors

abinavseelan avatar goldylucks avatar rheaditi 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar

react-input-trigger's Issues

Cant set endTrigger with React Hook useState

I am using a functional component and I am unable to set the endTrigger with a set state function

<InputTrigger
        trigger={{
          keyCode: 50,
          shiftKey: true,
        }}
        onType={toggleSuggesting}
        onCancel={toggleSuggesting}
        endTrigger={setEndMention}
      >

npm package has src version

after I run $ yarn add react-input-trigger, I've ended up with this:

image

I got the dev build instead the prod build. Please fix so I can use this cool package :)

as a workaround for now I've copy pasted the package into my source code, and it works

Doesn't work with MaterialUI TextFields

Hi,

I wanted to implement react-input-trigger to project I work on. There I use MaterialUI and TextFields.
However react-input-trigger fails with onStart

Uncaught TypeError: Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'.

My component is as simple as:

const TextFieldComponent = ({ input, meta: { touched, error }, ...custom }) => {

  const isError = Boolean(touched && error)
  let helperText = custom.label !== custom.helperText ? custom.helperText : undefined
  if (!helperText && error) {
    helperText = error
  }

  return <InputTrigger
    trigger={{
      keyCode: 51,// hash code
      shiftKey: true,
    }}
    onStart={(metaData) => { console.log(metaData) }}
  >
    <TextField
      error={isError}
      {...input}
      {...custom}
      helperText={helperText}
      variant="outlined"
      margin="normal"
    />
  </InputTrigger>
}

Seems error comes from dependency textarea-caret-position https://github.com/component/textarea-caret-position/blob/master/index.js#L71

Any idea how to make it work? It seems to me that it works only with html tags (textarea or input) and not React components, am I right?

Styling issues due to intermediate <div>

Description

Currently the component renders the children input field(s) / textarea(s) by wrapping them in an intermediate <div> tag, which handles events.

This however introduced styling issues, especially with flex styles, since the intermediate <div> enforced block styling.

The fix for this was to pass on user styles, classnames and other information on to the component as props.

Will it support Multiple KeyCode Trigger?

I am looking for a feature like slack where user can trigger different action through different input ("/" for command actions and "@" for user mentions). will this library support that?

keyCode differs on AZERTY keyboard

Hello,

I'm trying to implement a mention system on my react app.
I noticed that the keycode:50 and shiftkey:true will still be triggered even though the input will be '2' on an azerty keyboard. Knowing people might potentially use an azerty keyboard this is pretty blocking. Is there a way to trigger not based on a keyCode, but with a simple string comparison ?

Thanks

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.