instructure / canvas-lms

The open LMS by Instructure, Inc.
https://github.com/instructure/canvas-lms/wiki
GNU Affero General Public License v3.0
5.45k stars 2.44k forks source link

Remove User Content jQuery UI Warning #2125

Open NateLevin1 opened 1 year ago

NateLevin1 commented 1 year ago

Summary:

When trying to use the enhanceable_content CSS class to add UI components to user content, an error is printed to the console reading the following upon any user loading the page:

Deprecated use of magic jQueryUI widget markup detected: You're relying on undocumented functionality where Canvas makes jQueryUI widgets out of rich content that has the following class names...

This error message was introduced over 6 years ago and yet these components still work great. Because of this, I think it would be useful to reword or even remove the error message.

Here is the code that causes this behavior:

https://github.com/instructure/canvas-lms/blob/0822f7ff24ef2ee59166afd7cdac72996200413e/ui/shared/enhanced-user-content/jquery/index.js#L94-L103

Steps to reproduce:

  1. Go to a rich text editor
  2. Go to the HTML view
  3. Type the following code:
    <div class="enhanceable_content tabs">
    <ul>
    <li><a href="#tabs-1">Nunc tincidunt</a></li>
    <li><a href="#tabs-2">Proin dolor</a></li>
    </ul>
    <div id="tabs-1">
    Proin
    </div>
    <div id="tabs-2">
    Morbi
    </div>
    </div>
  4. Save
  5. When you view the content, it will correctly show the tabs.
  6. In the console, it logs the error message outlined above.

Expected behavior:

No error message should be printed.

Actual behavior:

The error message is printed.