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

Add paste support for desktop and web + fix maxLength input #253

Merged
merged 7 commits into from Oct 16, 2023

Conversation

DigiEggz
Copy link
Contributor

@DigiEggz DigiEggz commented Aug 10, 2023

Add support for desktop and HTML5 javascript paste events by adding an event handler that fills the field as the parent text element changes. Fixes an issue with maxLength text entry. Closes #251.

@Geokureli
Copy link
Member

can't try this right now, but will soon

@Geokureli
Copy link
Member

is this still an issue #251?

@DigiEggz
Copy link
Contributor Author

is this still an issue #251?

Yes, that issue still persists.

@DigiEggz
Copy link
Contributor Author

DigiEggz commented Aug 10, 2023

I've adjusted the priority of the KeyboardEvent.KEY_DOWN listener to allow all events. It needs tested to make sure it doesn't interfere with scrolling the page.

Copy link
Member

@Geokureli Geokureli left a comment

Choose a reason for hiding this comment

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

on this branch, paste doesn't work for me on Chrome or Firefox, i set a breakpoint on case V if (e.ctrlKey): and it hits but on html5 it's not pasting the clipboard it's only selecting/focusing the text, is this on purpose? is it reading from that textfield at some other place in code?

not sure why I can't paste, I'm able to paste into HaxeUI-Flixel textfields on chrome, I think.

@DigiEggz
Copy link
Contributor Author

I'll check to see what's going on. It's currently working for me in all mentioned browsers. When trying to paste, are you copying content to paste before or after the application has initialized? I may have some changes incorporated from the latest version of OpenFL.

@DigiEggz
Copy link
Contributor Author

I believe I found the issue. I did not account for maxLength == 0 allowing unlimited text in the field.

@Geokureli Geokureli merged commit dc4aec5 into HaxeFlixel:dev Oct 16, 2023
15 checks passed
@Geokureli
Copy link
Member

Thanks!

Geokureli added a commit that referenced this pull request Dec 22, 2023
@Geokureli Geokureli added this to the 2.6.0 milestone Mar 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Space doesn't work on FlxInputText in html5
2 participants