Skip to content

Commit c5d7a88

Browse files
SK-1952 update listener on update call
1 parent 5a9a179 commit c5d7a88

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

Sources/Skyflow/elements/TextField.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,13 +264,16 @@ public class TextField: SkyflowElement, Element, BaseElement {
264264
listCardTypes = schemes
265265
if let cardTypes = listCardTypes, cardTypes.count >= 2 {
266266
getDropDownIcon()
267-
selectedCardBrand = listCardTypes?[0]
267+
selectedCardBrand = listCardTypes?[0]
268+
} else {
269+
selectedCardBrand = nil
268270
}
269271
}
270272
}
271273
let t = self.textField.secureText!.replacingOccurrences(of: "-", with: "").replacingOccurrences(of: " ", with: "")
272274
let card = CardType.forCardNumber(cardNumber: t).instance
273275
updateImage(name: card.imageName, cardNumber: t)
276+
self.onChangeHandler?((self.state as! StateforText).getStateForListener())
274277
}
275278
let t = self.textField.secureText!.replacingOccurrences(of: "-", with: "").replacingOccurrences(of: " ", with: "")
276279
let card = CardType.forCardNumber(cardNumber: t).instance

0 commit comments

Comments
 (0)