Comments (10)
https://github.com/shaack/bootstrap-input-spinner/pull/62/files
ran into same issue, created fix
from bootstrap-input-spinner.
An easy fix can be to replace this line
var thousandSeparator = numberFormat.format(1111).replace(/1/g, '')
with this
var thousandSeparator = numberFormat.format(1111).replace(/1/g, '') | ' '
from bootstrap-input-spinner.
Hi, thanks for reporting. Okay, I switched the locale to russian, but get no error. Which Browser and OS? In Chrome, it seems to work.
from bootstrap-input-spinner.
Okay, looking deeper, after line 246 I've added this to debug:
console.log(locale, numberFormat.format(1111));
and it gave me this: es-AU 1111
My Chrome version: Version 78.0.3904.97 (Official Build) (64-bit)
from bootstrap-input-spinner.
Yep, I've forgotten that I've decided to learn Spanish language and have added Spanish (apparently in Google settings) to the list of languages.
One way or another, this regex construction '\\' + thousandSeparator
assumes that thousandSeparator
has to be strictly one character long string (not always true) that has to be escaped in regex (also may not be true). This is a dangerous assumption which may cease to work in some cases, like with the es-AU
locale here.
One more notice is that my OS is Ubuntu 16.04 LTS.
from bootstrap-input-spinner.
You are right. Looks like the localization feature needs to be reworked. Do you have an idea how to fix it? I can think about it next week, this week I have to much customer stuff to do.
from bootstrap-input-spinner.
I found some ideas here: https://stackoverflow.com/questions/11665884/how-can-i-parse-a-string-with-a-comma-thousand-separator-to-a-number
from bootstrap-input-spinner.
@shaack, any progress?
from bootstrap-input-spinner.
Same here with Polish locale.
Firefox reports an error in the console when I'm trying to insert input's value manually:
SyntaxError: \ at end of pattern 3 plugins.js:274:14
parseLocaleNumber https://localhost/foobar/js/plugins.20161010.js:269
inputSpinner https://localhost/foobar/js/plugins.20161010.js:122
jQuery 5
dispatch
handle
trigger
simulate
i
In Chrome:
Uncaught SyntaxError: Invalid regular expression: //: \ at end of pattern
at new RegExp ()
at parseLocaleNumber
at HTMLInputElement.
at HTMLInputElement.dispatch (jquery-3.5.1.min.js:2)
at HTMLInputElement.v.handle (jquery-3.5.1.min.js:2)
from bootstrap-input-spinner.
Fixed with 1e3de85
from bootstrap-input-spinner.
Related Issues (20)
- TypeError: this.destroyInputSpinner is not a function HOT 6
- Check input have already a spinner HOT 2
- Handle change event like the native spinner HOT 2
- include BS from a CDN HOT 1
- add version number to file .js HOT 1
- Multiple inputs all receive change event HOT 4
- Dynamic step while holding down button
- Issue on responsive HOT 1
- Remove jQuery
- Does not use passive listeners to improve scrolling performance HOT 3
- How to remove the value change behaviour on mouse scroll?
- Keyboard Stepping Continues After Tabbing HOT 1
- Semicolon is added at the start instead of at the end of the source. HOT 1
- BUG: min max and value change at the same time HOT 2
- Change event of an input spinner triggers the change events of all other input spinners
- Minification using Microsoft Visual Studio 22 causes "Identifier has already been declared Error" HOT 1
- How to for BootStrap 5 Floating Label Input HOT 2
- The width is too large HOT 1
- bootstrap-input-spinner.js adding "_MP_cBdLN29i2" to element id HOT 3
- Uncaught TypeError: Cannot read properties of undefined (reading 'bootstrap-input-spinner')
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bootstrap-input-spinner.