Page MenuHomePhabricator

Putting links or form elements into RadioSelectWidget/RadioSelectInputWidget option labels messes up tab ordering (loops infinitely inside the select)
Closed, ResolvedPublic

Description

Putting links or form elements into RadioSelectWidget/RadioSelectInputWidget option labels messes up tab ordering (loops infinitely inside the select).

Example use cases:

new OO.ui.RadioSelectWidget( {
	items: [
		new OO.ui.RadioOptionWidget( {
			data: 'a',
			label: $( $.parseHTML( 'Option A (<a href="http://example.com/a">details</a>)' ) )
		} ),
		new OO.ui.RadioOptionWidget( {
			data: 'b',
			label: $( $.parseHTML( 'Option B (<a href="http://example.com/b">details</a>)' ) )
		} ),
		new OO.ui.RadioOptionWidget( {
			data: 'c',
			label: $( $.parseHTML( 'Option C (<a href="http://example.com/c">details</a>)' ) )
		} )
	]
} )
new OO.ui.RadioSelectWidget( {
	items: [
		new OO.ui.RadioOptionWidget( {
			data: 'foo',
			label: 'Foo'
		} ),
		new OO.ui.RadioOptionWidget( {
			data: 'bar',
			label: 'Bar'
		} ),
		new OO.ui.RadioOptionWidget( {
			data: '',
			label: $( [
				document.createTextNode( 'Other: ' ),
				new OO.ui.TextInputWidget().$element
			] )
		} )
	]
} )

Event Timeline

matmarex created this task.Sep 28 2017, 8:45 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptSep 28 2017, 8:45 AM

Change 381179 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[oojs/ui@master] SelectWidget: Allow focussing things inside OptionWidget labels

https://gerrit.wikimedia.org/r/381179

Volker_E closed this task as Resolved.Sep 28 2017, 10:29 AM
Volker_E triaged this task as Normal priority.
Volker_E assigned this task to matmarex.
Volker_E removed a project: Patch-For-Review.
Volker_E moved this task from Backlog to OOjs-UI-0.23.3 on the OOUI board.
Volker_E edited projects, added OOUI (OOjs-UI-0.23.3); removed OOUI.

Change 381179 merged by jenkins-bot:
[oojs/ui@master] SelectWidget: Allow focussing things inside OptionWidget labels

https://gerrit.wikimedia.org/r/381179