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

Option to trigger onChange event #4

Open
martindsouza opened this issue Mar 29, 2016 · 11 comments
Open

Option to trigger onChange event #4

martindsouza opened this issue Mar 29, 2016 · 11 comments

Comments

@martindsouza
Copy link

It doesn't appear that modified text triggers an onChange event. Perhaps give an option to parameterize this.

@danhper
Copy link
Owner

danhper commented Mar 29, 2016

Hi, @martindsouza
Thanks for reporting.
Could you be a little more specific please?

By "modified text", do you mean modified with a normal user
input or modified by syncing with the text from the textarea?

@martindsouza
Copy link
Author

If I open a text area using the plugin then modify the text in Atom. When is an change event triggered on the webpage?

I'm looking for this feature since I use an online application builder that allows you to define code in a text area. When a change event occurs (tab out, etc) it triggers a code validation script. Since this plugin doesn't appear to be doing that I need to go back to the text area, add a blank space or make another change, then tab out to trigger the change event.

Does this make sense?

@danhper
Copy link
Owner

danhper commented Mar 29, 2016

@martindsouza

Thank you for the clarification.
Yes, this makes perfect sense.
The same issue occurs in StackOverflow where the preview is not updated,
so I used custom events to work around this:
https://github.com/tuvistavie/atomic-chrome/blob/master/src/content-script-tools/custom-events/stackoverflow.js
I did not find the time to allow user defined custom events, but this will definitely be necessary to add enough flexibility.

For this particular case, the keypress event could be emitted by default, which should solve the issue.
I am having trouble remembering why I decided not to emit the keypress in all cases,
but I will give it a try and if it seems to work I will update with this change.

In the meanwhile, if you want this to be fixed faster, you can add an event handler matching
the domain of the app builder you are using in the custom-events directory
with whatever event you need to trigger and send a PR to the Chrome plugin repo.

Thank you!

@martindsouza
Copy link
Author

@tuvistavie thanks for the detailed information. I've never built a browser or Atom plugin before so I'll need some learning time before making a PR. Will keep you posted.

@danhper
Copy link
Owner

danhper commented Mar 30, 2016

@martindsouza

I just updated the Chrome plugin to emit a keypress event on every change.

I think this should fix your issue, so please try to upgrade the Chrome plugin to 0.2.2 and let me know how it goes.

Thank you.

@danhper
Copy link
Owner

danhper commented Apr 8, 2016

@martindsouza Hi, any news here?

@martindsouza
Copy link
Author

@tuvistavie I updated to 0.2.4 and still have the same issue. I've included a gif of it below.

What happens is that after I enter a query and tab out, the app automatically checks with the DB if the syntax is valid. When using the plugin it doesn't since it doesn't appear that anything was changed in the field. In the second part I manually type in the content then tab out and you can see the validation occurred.

atomic

@danhper
Copy link
Owner

danhper commented Apr 8, 2016

@martindsouza Thank you very much for the details.
I am guessing the service you are using relies on the change event,
which I think is not triggered properly in our case.
Is this service freely available online, so that I could check it myself?
Thank you for your help!

@martindsouza
Copy link
Author

@tuvistavie Yes I believe it is. You can access the site at apex.oracle.com > Sign In (top right) > Request a Workspace (under Sign In button). Once you've logged in edit the demo application. If you have any issues let me know and I can provide more detailed steps.

@danhper
Copy link
Owner

danhper commented Apr 10, 2016

@martindsouza Thank you for the details. I gave it a try, but I could not figure out a way to make it work properly.
From what I experimented, when the SQL query box looses the focus, it seems to compare the value it has with the value it had before being focused, and trigger the validation when these are not equal,
but when using Atomic Chrome, it looses the focus as soon as Atom is focused, which I think it is why nothing happens although a keypress event is triggered.
If you find a way to programatically trigger the validation, I will be glad to test it.
Thank you!

@martindsouza
Copy link
Author

@tuvistavie I appreciate you looking into it some more. If I think of a way I'll let you know. I've got some busy weeks ahead of me so I won't be able to spend more time on it in the near future. I've set a reminder though to come back and look at this ticket.

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