fixed optional text position

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2024-05-23 11:59:13 -05:00
parent 13396d1501
commit 7953751a89
2 changed files with 4 additions and 4 deletions

View File

@ -222,11 +222,11 @@ open class DropdownSelect: EntryFieldBase {
updatedLabelText = showInlineLabel ? "" : updatedLabelText
if let oldText = updatedLabelText, !isRequired, !oldText.hasSuffix("Optional") {
let optionColorAttr = ColorLabelAttribute(location: oldText.count + 2,
let optionColorAttr = ColorLabelAttribute(location: oldText.count + 1,
length: 8,
color: secondaryColorConfiguration.getColor(self))
updatedLabelText = showInlineLabel ? "Optional" : "\(oldText) Optional"
updatedLabelText = showInlineLabel ? "Optional" : "\(oldText) Optional"
attributes.append(optionColorAttr)
}

View File

@ -360,13 +360,13 @@ open class EntryFieldBase: Control, Changeable, FormFieldInternalValidatable {
//dealing with the "Optional" addition to the text
if let oldText = updatedLabelText, !isRequired, !oldText.hasSuffix("Optional") {
if isEnabled {
let optionColorAttr = ColorLabelAttribute(location: oldText.count + 2,
let optionColorAttr = ColorLabelAttribute(location: oldText.count + 1,
length: 8,
color: VDSColor.elementsSecondaryOnlight)
attributes.append(optionColorAttr)
}
updatedLabelText = "\(oldText) Optional"
updatedLabelText = "\(oldText) Optional"
}
if let tooltipModel {