I have overridden the default styles for input controls and, so far, have not encountered any rendering issues except with TimeItem when useTextField="false" is used.
With my custom styles applied, the component is rendered incorrectly (see screenshot below).

After reviewing the source code, I found that the width of the internal SelectItem controls is calculated in the code section shown below. The calculation does not appear to take into account the additional space introduced by the custom CSS styles.
Custom CSS
Current implementation in isc.TimeItem.setItems()
Question
Would it be possible to replace this code with a version that takes the padding defined in controlStyle into account?
I tested the following modification locally and it appears to work correctly:
I also noticed a related issue with the PickList width.
When clicking any of the three SelectItems within the TimeItem for the first time, the PickList is displayed with an incorrect width.
After closing and opening the same PickList again, its width is calculated correctly and the PickList is displayed as expected.
This behavior suggests that the initial width calculation may not be taking all style-related dimensions into account, while subsequent openings use an updated or recalculated width.

With my custom styles applied, the component is rendered incorrectly (see screenshot below).
After reviewing the source code, I found that the width of the internal SelectItem controls is calculated in the code section shown below. The calculation does not appear to take into account the additional space introduced by the custom CSS styles.
Custom CSS
Code:
.selectItemControl,
.selectItemControlOver,
.selectItemControlDisabled,
.selectItemControlError,
.selectItemControlErrorOver,
.selectItemControlFocused,
.selectItemControlFocusedOver
{
border: var(--border);
border-radius: 4px;
padding-left: 8px;
padding-right: 2px;
}
.selectItemText,
.selectItemTextOver,
.selectItemTextDown,
.selectItemTextError,
.selectItemTextErrorOver,
.selectItemTextFocused,
.selectItemTextFocusedOver,
.selectItemTextDisabled,
.selectItemTextHint,
.selectItemTextDisabledHint,
.comboBoxItemPendingText {
border: 0;
padding: 0px;
}
Code:
var baseStyleName = isc.SelectItem.getInstanceProperty("textBoxStyle"),
// get the extra width to add to the render-width of the widest valueMap entry
extraWidth = isc.SelectItem.getInstanceProperty("pickerIconWidth") +
isc.Element._getLeftMargin(baseStyleName) +
isc.Element._getRightMargin(baseStyleName) +
isc.Element._getHBorderPad(baseStyleName) +
4 // this last is necessary because there is no right-padding
;
Would it be possible to replace this code with a version that takes the padding defined in controlStyle into account?
I tested the following modification locally and it appears to work correctly:
Code:
var baseStyleName = isc.SelectItem.getInstanceProperty("controlStyle"),
textBaseStyleName = isc.SelectItem.getInstanceProperty("textBoxStyle"),
rightPadding = isc.Element._getRightPadding(baseStyleName) ? 0 : 4;
// get the extra width to add to the render-width of the widest valueMap entry
extraWidth = isc.SelectItem.getInstanceProperty("pickerIconWidth") +
isc.Element._getHBorderPad(baseStyleName) +
isc.Element._getLeftMargin(textBaseStyleName) +
isc.Element._getRightMargin(textBaseStyleName) +
isc.Element._getHBorderPad(textBaseStyleName) +
rightPadding // this last is necessary because there is no right-padding
;
I also noticed a related issue with the PickList width.
When clicking any of the three SelectItems within the TimeItem for the first time, the PickList is displayed with an incorrect width.
After closing and opening the same PickList again, its width is calculated correctly and the PickList is displayed as expected.
This behavior suggests that the initial width calculation may not be taking all style-related dimensions into account, while subsequent openings use an updated or recalculated width.
Comment