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

this.getCurrentRange is not a function on Android #315

Closed
sebawagner opened this issue Apr 27, 2020 · 10 comments
Closed

this.getCurrentRange is not a function on Android #315

sebawagner opened this issue Apr 27, 2020 · 10 comments

Comments

@sebawagner
Copy link

sebawagner commented Apr 27, 2020

Testing the module on Android leads to an issue where some event notifiers don't seem to work:
image

And looking through the console debug it looks like:
image

Is that a platform specific issue?

That is Chrome 81.0.4044.117 on Android 9
And wicket-jquery-ui version 9.0.0-M5

@sebawagner
Copy link
Author

Its this line in the plugin:
https://github.com/sebfz1/wicket-jquery-ui/blob/wicket9.x/wicket-jquery-ui-plugins/src/main/resources/com/googlecode/wicket/jquery/ui/plugins/wysiwyg/resource/js/bootstrap-wysiwyg.js#L64

I'm not sure why it can't find the function defined on the bottom?
https://github.com/sebfz1/wicket-jquery-ui/blob/wicket9.x/wicket-jquery-ui-plugins/src/main/resources/com/googlecode/wicket/jquery/ui/plugins/wysiwyg/resource/js/bootstrap-wysiwyg.js#L181

Is "this" in this context maybe not referencing to the object ? Cause $( window ) hasn't been created using the "new" constructor ? So it won't find any methods that have been prototype'd into the object ?

@sebawagner
Copy link
Author

sebawagner commented Apr 27, 2020

Yep I'm pretty sure "this" is the problem. The context is different.
You can debug it and "this" is not pointing at the current Wysiwyg that the touch event is attached to. But pointing against "window" where there is no proto functions.

@martin-g
Copy link
Collaborator

Hi @sebawagner !

IMO this issue should be reported to bootstrap-wysiwyg.js project.
Wicket JQuery UI just adds integration with Wicket on top.

@sebawagner
Copy link
Author

Hi @sebawagner !

IMO this issue should be reported to bootstrap-wysiwyg.js project.
Wicket JQuery UI just adds integration with Wicket on top.

But which one? I can find several projects with that name. Which one did wicket-jquery-ui fork/copy ?

And actually wicket-jquery-ui hosts a raw source file. So - if I find the bootstrap-wysiwyg project this came from, how will this change be populated here?

@martin-g
Copy link
Collaborator

The link to the project is at the top of the JS file:

https://github.com/steveathon/bootstrap-wysiwyg

The bad news is that there is no much activity in this project since 2018.

@sebawagner
Copy link
Author

There is actually a fix proposed and committed in that repo:
steveathon/bootstrap-wysiwyg@aa73cd3#diff-5533b3a46c8d44c5a0d1f3198ee1cd9a

But the fix doesn't work. I checked the fix.
The fix does if(!this.getCurrentRange)
This will never be true. So you could also just delete this method. It seems to have no effect on the overall functionality anyway. I'm not sure what it is supposed to do.

@sebawagner
Copy link
Author

I've created an issue in their Repo: steveathon/bootstrap-wysiwyg#152

But will you import those latest changes to get rid of the console error ?

@sebawagner
Copy link
Author

Although not fixing the issue :) It at least stops your browser from making a funny noise when there is a console.error :)

@sebfz1
Copy link
Owner

sebfz1 commented May 4, 2020

Hi Sebastian, thanks for reporting the issue!
Maxim provided the fix. 9.0.0-M5.1 is now on its way to maven central...

@sebfz1 sebfz1 closed this as completed May 4, 2020
@sebawagner
Copy link
Author

Great thanks!

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

3 participants