question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add option to allow spaces

See original GitHub issue

I ran across a situation where I needed to allow spaces inside a Cleave field (in React) but spaces are disallowed by default. An allowSpaces option would be really helpful. I worked around it by adding this to the options for that field:

blocks: [99999],
delimiter: ''

However, an allowSpaces option would have been quite helpful. Thanks!

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:18
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
ahahn95commented, Apr 23, 2019

I have a component that sometimes needs formatted input and sometimes just needs to be an input field and I don’t want to put logic in to swap out the field. I ended up using @jdsteinbach’s solution.

0reactions
nosircommented, Mar 14, 2020

Space is the default delimiter, but it only takes effect when a format type option is specified, e.g. numeral, phone, blocks, etc… I think in your case, none of those type actually applies, so just to passing an empty option object can actually prevent format happening, which allows any space entering, and this feels like a more intuitive way for me. While your workarounds also works 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I put a space character before option text in ...
Press ALT and type 0160 on your numeric keypad, so it should be something like ALT+0160 . It will add a space. ListItem("ALT+0160...
Read more >
Create or delete a space grouped by topic in Google Chat
The option to create spaces that allow guests is only available on Google Workspace accounts. Tap Advanced Drop-down arrow and then ...
Read more >
Change the spaces between text
The idea is to give a better looking result by reducing the spacing between characters that fit together nicely (such as "A" and...
Read more >
How whitespace is handled by HTML, CSS, and in the DOM
These characters allow you to format your code in a way that will make it easily readable by yourself and other people. In...
Read more >
Assign space permissions | Confluence Cloud
Select an Edit Permissions button (under Groups, Individual Users, or Anonymous Access). To add a new individual user to your space: Go to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found