Skip to main content

Search and Top Navigation

#8846 closed feature (notabug)

Opened November 23, 2012 09:47AM UTC

Closed November 23, 2012 10:04AM UTC

Allow Default Click Event on Elements Within Selectable - Feature Request

Reported by: chrishiestand Owned by:
Priority: minor Milestone: 1.10.0
Component: ui.selectable Version: 1.9.1
Keywords: Cc:
Blocked by: Blocking:
Description

The current lack of default click or double-click events for selectable elements is frustrating.

The "distance" parameter is not a sufficient workaround for many cases.

I have a couple ideas that I think would fix the problem.

1. Allow default clicks on anything that does not match the filter option. In the example below, the filter only matches span elements. But at the moment, the links cannot be clicked. These could be allowed.

<ul class="ui-selectable" id="selectme">
  <li><span>Here is item 1</span> <a href="1">(1 It would be useful to be able to click here)</a></li>
  <li><span>Here is item 2</span> <a href="2">(2 It would be useful to be able to click here)</a></li>
  <li><span>Here is item 3</span> <a href="3">(3 It would be useful to be able to click here)</a></li>
</ul>

<script type="text/javascript">
$(function() {
        $( "#selectme" ).selectable({
          filter: 'span',
        });
    });
</script>

2. Add a separate filter, e.g. "defaultEventFilter" that determines which elements will fire their default event.

<script type="text/javascript">
$(function() {
        $( "#selectme" ).selectable({
          defaultEventFilter: 'a',
        });
    });
</script>

3. ??? Whatever implementation is best is fine with me. But I think this behavior need to be improved.

Attachments (0)
Change History (2)

Changed November 23, 2012 10:03AM UTC by chrishiestand comment:1

Nevermind, the "cancel" option does exactly this, but I did not notice it earlier. Let's close this ticket.

Changed November 23, 2012 10:04AM UTC by jzaefferer comment:2

resolution: → notabug
status: newclosed

Alright, thanks for the update.