Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with Bitwarden (Password Manager) #68

Closed
perarg opened this issue Apr 20, 2020 · 10 comments
Closed

Issues with Bitwarden (Password Manager) #68

perarg opened this issue Apr 20, 2020 · 10 comments
Labels
wontfix This will not be worked on

Comments

@perarg
Copy link

perarg commented Apr 20, 2020

"A picture is worth a thousand words".

I am trying to show the issue with an animated gif here:
input_fromDesktop

Here is a typical example of bootstrap-input-spinner rendered in a form and working in a dekstop computer. What i am trying to do, is to type the amount of "3,45" or "3.45" (if you prefer). As you can see by the keystrokes i haved demostrated, it's almost impossible. I made some tries and then finally i achieve to type in correctly.
I don't think the ideal solution is to use the buttons for all cases. Think if you have to type in the amount of ex. 645 or 4 589

But what about a regular user, not so much experienced ?

You can try yourself in example page of-course Demo example page

P.S. It doesn't seem the same issue from mobile.

@perarg
Copy link
Author

perarg commented Apr 20, 2020

How about removing input event from $input.on("paste input change focusout") ?
In this way, the user will type whatever she wants (even forbidden characters) but when she focusout the parseLocaleNumber function will be executed and fixes values.

@shaack
Copy link
Owner

shaack commented Apr 20, 2020

Hi, with which system and browser do you have this behaviour. I can not reproduce it. The number is parsed on focusout and not while typing.

@perarg
Copy link
Author

perarg commented Apr 20, 2020

You are right, in Safari this doesn't happened.
The above gif is recorded in macOS 10.13.6 and Firefox v75 (latest).

The parseLocaleNumber function is called when $input paste, input, change and when focusout. Maybe it has different behaviour the input and change event between browsers?

@shaack
Copy link
Owner

shaack commented Apr 20, 2020

The input is only updated on "focusout", see in the code:

var focusOut = event.type === "focusout"
newValue = parseLocaleNumber(newValue)
setValue(newValue, focusOut)

The second paramater ist "updateInput". If false, the input will not be updated. The update will only happen on "focusout". For me it works, even with Firefox 75.

@perarg
Copy link
Author

perarg commented Apr 20, 2020

@shaack it is the Bitwarden (Password Manager) plugin in firefox causing the issue. I don't believe i have spent my time but especially your time for it... I apologise and close the issue.

@perarg perarg closed this as completed Apr 20, 2020
@shaack
Copy link
Owner

shaack commented Apr 20, 2020

No problem. Thanks for supporting the input-spinner with your time.

@FionNoir
Copy link

FionNoir commented May 18, 2020

Changing the event listener will solve the issue.
I've diveded the single function
$input.on("paste change focusout", function (event) {.....}
into two functions:

$input.on("paste change focusout", function (event) {
            var newValue = $input[0].value
            var focusOut = event.type === "focusout"
            newValue = parseLocaleNumber(newValue)
            setValue(newValue, focusOut)
            dispatchEvent($original, event.type)
 })


 $input.on("input", function (event) {
             var newValue = $input[0].value
             var focusOut = event.type === "focusout"
             newValue = parseLocaleNumber(newValue)
             setValue(newValue, focusOut)
             //dispatchEvent($original, event.type)
  })

Important was to prevent the input event from calling dispatchEvent($original, event.type) this solves the issue as far as I can see.

@shaack
Copy link
Owner

shaack commented May 19, 2020

Okay, but this prevents the input event from being dispatched to the original input-element. As far as I understand, the Bitwarden (Password Manager) plugin has a bug, so why should this be fixed in the spinner?

@shaack shaack reopened this May 19, 2020
@shaack shaack changed the title Almost impossible to type a float number in desktop Don't works with Bitwarden (Password Manager) May 19, 2020
@shaack shaack changed the title Don't works with Bitwarden (Password Manager) Doesn't work with Bitwarden (Password Manager) May 19, 2020
@shaack shaack changed the title Doesn't work with Bitwarden (Password Manager) Issues with Bitwarden (Password Manager) May 19, 2020
@FionNoir
Copy link

FionNoir commented May 19, 2020

I still can't say why this is working, but it works everywhere I've tested.
The dispatchEvent() now is triggered by pressing Enter or Focus Out and this works fine in my use case. But you're right, it's not a clean solution.

And there might by something wrong with the password managers in general.
I can confirm that having the Enpass Password Manager also causes this issue. Uninstalling fixes it.
But it also shows that the bowser processes input and change events differently.

@shaack shaack added the wontfix This will not be worked on label Jul 19, 2020
@shaack shaack closed this as completed Jul 30, 2020
@shaack
Copy link
Owner

shaack commented Jul 30, 2020

It seems to be a Bug of Bitwarden

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants