Set the ID on the main widget (mw.widgets.SelectWithInputWidget), so
that it can be infused by ID.
The dropdown/textbox by themselves can't be infused individually,
therefore IDs on them are pretty useless; remove those where they're
not necessary.
Follow-up to
8bd6605736c47259bd5f901284cbd2e639cef30c.
Change-Id: If54dd48f1000e3e0f5a978428a5b622797b4f765
# TextInput
$textAttribs = [
# TextInput
$textAttribs = [
- 'id' => $this->mID . '-other',
'name' => $this->mName . '-other',
'size' => $this->getSize(),
'class' => [ 'mw-htmlform-select-and-other-field' ],
'name' => $this->mName . '-other',
'size' => $this->getSize(),
'class' => [ 'mw-htmlform-select-and-other-field' ],
- 'data-id-select' => $this->mID,
+ 'data-id-select' => $this->mID . '-select',
# DropdownInput
$dropdownInputAttribs = [
'name' => $this->mName,
# DropdownInput
$dropdownInputAttribs = [
'name' => $this->mName,
+ 'id' => $this->mID . '-select',
'options' => $this->getOptionsOOUI(),
'value' => $value[1],
];
'options' => $this->getOptionsOOUI(),
'value' => $value[1],
];
}
return $this->getInputWidget( [
}
return $this->getInputWidget( [
'textinput' => $textAttribs,
'dropdowninput' => $dropdownInputAttribs,
'or' => false,
'textinput' => $textAttribs,
'dropdowninput' => $dropdownInputAttribs,
'or' => false,
# DropdownInput
$dropdownAttribs = [
# DropdownInput
$dropdownAttribs = [
'name' => $this->mName,
'options' => $this->getOptionsOOUI(),
'value' => $valInSelect ? $value : 'other',
'name' => $this->mName,
'options' => $this->getOptionsOOUI(),
'value' => $valInSelect ? $value : 'other',
# TextInput
$textAttribs = [
# TextInput
$textAttribs = [
- 'id' => $this->mID . '-other',
'name' => $this->mName . '-other',
'size' => $this->getSize(),
'value' => $valInSelect ? '' : $value,
'name' => $this->mName . '-other',
'size' => $this->getSize(),
'value' => $valInSelect ? '' : $value,
}
return $this->getInputWidget( [
}
return $this->getInputWidget( [
'textinput' => $textAttribs,
'dropdowninput' => $dropdownAttribs,
'or' => true,
'textinput' => $textAttribs,
'dropdowninput' => $dropdownAttribs,
'or' => true,