Coder Social home page Coder Social logo

Comments (6)

avocadowastaken avatar avocadowastaken commented on May 31, 2024 1

@leMaik thank you 👍 I wish today I will have free time to contribute 😅

from material-ui-chip-input.

leMaik avatar leMaik commented on May 31, 2024

Nice workaround! I'm not sure if this should be added to the component as it is, though.

There is a prop newChipKeyCodes that specifies key codes that "break" chips while typing (only 13 by default). If you could automatically determine the corresponding characters and split by those characters, I'd love to see a PR from you! 👍

from material-ui-chip-input.

avocadowastaken avatar avocadowastaken commented on May 31, 2024

@leMaik oh, thanks for fast response 👍

newChipDelimiter - will be good ?
or something like clipboardTextDelimiter - that would only work with paste?
also current behavior needs some updates cause it will submit value every time when user paste value.


So:

  • addOnPaste: bool - will prevent default onPaste behavior and request to add value from clipboard
  • clipboardTextDelimiters: arrayOf(string) - will split text from clipboard by passed delimiters
  • or parseClipboardText: func - function to create array from clipboard text
  • addOnPasteMultiple: bool - will prevent default onPaste only if clipboard text was split to array with more than one chip

from material-ui-chip-input.

leMaik avatar leMaik commented on May 31, 2024

@umidbekkarimov That's really a lot of additional complexity for the single use-case of copying stuff from a spreadsheet. 😕 I'd like to add just one, or even no new props at all.

As you see, the intended behavior can already be achieved by using onPaste, so there is no need for new props.

from material-ui-chip-input.

avocadowastaken avatar avocadowastaken commented on May 31, 2024

@leMaik agree. I can add it as an example to the storybook in case if someone will need similar functionality.

from material-ui-chip-input.

leMaik avatar leMaik commented on May 31, 2024

@umidbekkarimov That would be great! I'll update the story book so that you can see the source code for the examples there.

from material-ui-chip-input.

Related Issues (20)

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.