Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#10144 closed bug (fixed)

Selectmenu: Losing selection when accesing menu

Reported by: spjonez Owned by:
Priority: minor Milestone: 1.11.1
Component: ui.selectmenu Version: 1.11.0
Keywords: Cc:
Blocked by: Blocking:

Description

Fiddle: http://jsfiddle.net/TdLvC/

In the original plugin clicking the menu did not clear any text selection in the browser. Maintaining the selection is necessary if you want to use the dropdown to apply actions to a selection in a contenteditable div.

Change History (6)

comment:1 Changed 3 years ago by tj.vantoll

  • Summary changed from Losing selection when accesing menu to Selectmenu: Losing selection when accesing menu

This seems like a reasonable use case to me, as native controls don't do this. fnagel, any idea what's causing this?

comment:2 follow-up: Changed 3 years ago by fnagel

I've played around with this and was not able to identify why the selection is lost. It's working in my old fork version but I have no clue why as this was never tested or intended.

Here's a (working) demo of this using my old fork: http://jsfiddle.net/GXtpC/1218/

Any experience with this for button widget?

comment:3 in reply to: ↑ 2 Changed 3 years ago by spjonez

Replying to fnagel:

I've played around with this and was not able to identify why the selection is lost. It's working in my old fork version but I have no clue why as this was never tested or intended.

Here's a (working) demo of this using my old fork: http://jsfiddle.net/GXtpC/1218/

Any experience with this for button widget?

I haven't been able to find it either. Commented almost the entire selectmenu code out, added preventDefault and stopPropagation everywhere I could, seems like the base click is coming from menu/widget? Whatever binding applies ui-state-focus on the button itself is allowing the click to go through.

comment:4 Changed 3 years ago by scottgonzalez

  • Status changed from new to open

comment:5 Changed 3 years ago by Scott González

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

Selectmenu: Preserve text selection when interacting with the widget

Fixes #10144 Closes gh-1295

Changeset: 749a6a56677fe29d2bf777d79811ce8bdd1b5fad

comment:6 Changed 3 years ago by scottgonzalez

  • Milestone changed from none to 1.11.1
Note: See TracTickets for help on using tickets.