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

odd issue prevent me to copy or paste into text fields, only at times #4107

Closed
adv0r opened this issue Jan 14, 2016 · 11 comments
Closed

odd issue prevent me to copy or paste into text fields, only at times #4107

adv0r opened this issue Jan 14, 2016 · 11 comments

Comments

@adv0r
Copy link

adv0r commented Jan 14, 2016

I'm finding a very odd issue that I was able to replicate on multiple machines.

I have an html+js app that I wrapped around with Electron. I am having problem with the MacOS distribution.
There is one HTML text field that won't let me paste text into it. This bug only happens after I follow the procedure to distribute the app (copy my app/ folder into Electron.app).

In all the other instances, I can copy or paste just fine :

  • when I run it via npm start (mac and win)
  • when I run it by doubleclicking electron.app and dragging app/ over it
  • on windows

I wonder, what can be the difference there? How can I debug something like this?

@zcbenz
Copy link
Member

zcbenz commented Jan 15, 2016

This is very likely a duplicate of #1151.

@zcbenz zcbenz closed this as completed Jan 15, 2016
@adv0r
Copy link
Author

adv0r commented Jan 15, 2016

Thanks for pointing that out.

in #1151 the problem seems to be related to focus. This isn't happening to me, in fact I can type freely into the field. I just cannot paste into it or copy text from it.

The solution moreover seems to be specific to Atom, while I am not using it at all here :

specifying the full path to the Atom command within Atom.app solved the issue for me.

@zcbenz
Copy link
Member

zcbenz commented Jan 16, 2016

Can you provide an example app?

@adv0r
Copy link
Author

adv0r commented Jan 18, 2016

not as-is, let me try to reduce it to the minimum

@adv0r
Copy link
Author

adv0r commented Jan 18, 2016

@zcbenz here you can try to reproduce it yourself

http://gofile.me/6nytF/6RM4yvTI . I had to stripe down quickly most unrelated files and html elements. Some fonts and css and js are still there so you can reproduce it .

Try to run it with npm start (mac) , and then by placing it inside Electron.app .

Basically cmd+a, cmd+c and cmd+v are disabled (only in the second case) ..

additional note, maybe un-related maybe not. When ran with npm start ,I get an error in console the first time I select any text in that form :

2016-01-18 16:22:32.485 Electron Helper[29342:6918638] Couldn't set selectedTextBackgroundColor from default () 

@zcbenz
Copy link
Member

zcbenz commented Jan 19, 2016

The link says "Unable to download file(s).".

I guess you are not creating an application menu for your app, the default app of Electron will create a default application menu when running an app, but once packaged the default application menu will be gone. All the default accelerators rely on the application menu to work.

@adv0r
Copy link
Author

adv0r commented Jan 19, 2016

the link expired, sorry for the inconvenience. here is the new link, validity extended for a week

I guess you are not creating an application menu for your app

You are right, I am not creating it. Should I try creating one following this tutorial?

@zcbenz
Copy link
Member

zcbenz commented Jan 20, 2016

Should I try creating one following this tutorial?

Yeah, the template in Menu docs is a good start, you might want to remove the devtools related items in final product.

@adv0r
Copy link
Author

adv0r commented Jan 21, 2016

Thanks, I tried: I added a basic application menu to my application.

As a result now I am unable to cmd+[a|c|v] also when launched via npm start

I packed the sample app and re-uploaded here

@zcbenz
Copy link
Member

zcbenz commented Jan 21, 2016

That's because you didn't add menu items for copy/paste.

@adv0r
Copy link
Author

adv0r commented Jan 22, 2016

That fixed it, thanks.
EDIT:
I wonder if I can use the same technique to disable refreshing (or if you know a different way to disable it)

Edit2: Yes, I could disable refreshing this way

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

No branches or pull requests

2 participants