Bug Tracker

Modify

Ticket #1887 (closed bug: fixed)

Opened 6 years ago

Last modified 5 years ago

Sortables -- bad options do not fail gracefully, explode

Reported by: Bradley Owned by: rworth
Priority: minor Milestone: 1.2.2
Component: ui Version: 1.2.1
Keywords: ui, sortable, draggable Cc:
Blocking: Blocked by:

Description

Some sortable options do not fail gracefully/silently if passed an argument of the wrong type. For instance, the update option expects a function. If you pass a string by accident, it should fail gracefully but rather goes into an infinite loop of errors.

Infinite loop of errors

$("#list li").sortable({

update: 'oops its a string'

});

A simple conditional could stop this effect:

Pseudocode

if (typeof theargument != 'function') { fail gracefully }

I've seen this with sortables, specifically the stop and update options, but I'm sure it's in other areas such as draggables also. While it does take human error to trigger it, human error should not make your browser explode.

Change History

comment:1 Changed 6 years ago by rworth

  • Owner set to rworth
  • Status changed from new to assigned

comment:2 Changed 5 years ago by rworth

  • Status changed from assigned to closed
  • Resolution set to fixed

Fixed in [4216]

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.