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

Redactor - Error: Uncaught TypeError: $(...).closest(...).size is not a function - Solution #684

Open
AngelDios opened this issue May 2, 2019 · 0 comments

Comments

@AngelDios
Copy link

Hello, I came across this problem with Redactor which was presented to me after updating composer.json, reviewing by the inspector I came across the error:
Uncaught TypeError: $(...).closest(...).size is not a function,

image

After reviewing I saw that the error was presented in the line 1463 of the redactor. js

image

generated by the update that was made of the jquery (version 3.x), searching the web I found the solution to the problem, I want to know if it is a feasible solution or has to be corrected in another way.

Solution:

original

line 1463: if ($(e.target).closest('.redactor-editor, .redactor-toolbar, .redactor-dropdown').size() !== 0)
line 6913: if ($current.closest(element).size() > 0)

modified
line 1463: if ($(e.target).closest('.redactor-editor, .redactor-toolbar, .redactor-dropdown').length !== 0)
line 6913: if ($current.closest(element).length > 0)

Reference: stackoverflow

P.D: I'm still waiting to solve this case

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

No branches or pull requests

2 participants