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

fix lockPage password issue #178

Merged
merged 1 commit into from
Dec 14, 2021
Merged

Conversation

lvshaoping007
Copy link
Contributor

fix lock page password input error #158

Copy link
Contributor

@pro-wh pro-wh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixes #158

previously, trimming on every input event would delete spaces that go into the middle of a password, because the part that came after wouldn't be typed yet. this PR moves the trimming to a single operation at the end.

I suppose the trimming overall is still good, in case people are copying from a password manager and accidentally select some extra whitespace

@pro-wh
Copy link
Contributor

pro-wh commented Dec 14, 2021

I'm going to rebase and merge

@pro-wh pro-wh merged commit 43f1cfc into oasisprotocol:master Dec 14, 2021
@lukaw3d
Copy link
Member

lukaw3d commented Dec 14, 2021

I wouldn't trim

All trimmed characters:

new Array(65545).fill(0).map((z, ix) => [ix, String.fromCharCode(ix)]).filter(([ix, char]) => char !== char.trim())
[9, '\t']
[10, '\n']
[11, '\v']
[12, '\f']
[13, '\r']
[32, ' ']
[160, ' ']
[5760, ' ']
[8192, ' ']
[8193, ' ']
[8194, ' ']
[8195, ' ']
[8196, ' ']
[8197, ' ']
[8198, ' ']
[8199, ' ']
[8200, ' ']
[8201, ' ']
[8202, ' ']
[8232, '
']
[8233, '
']
[8239, ' ']
[8287, ' ']
[12288, ' ']
[65279, '']

@pro-wh
Copy link
Contributor

pro-wh commented Dec 16, 2021

do we want to preserve some of those?

@lukaw3d
Copy link
Member

lukaw3d commented Dec 16, 2021

All of them :D

@pro-wh
Copy link
Contributor

pro-wh commented Dec 16, 2021

filed as #186 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants