Link string value work from second click and up

Upon first clicking of an IconButton, it opens the mobile phone application but doesn’t pass the phone number ( “tel:” + $w(“#input6”).value ). When, clicking the same IconButton or other similar buttons in the form a second time and up, the phone number is transferred.
What could be the reason? Is there any solution to bypass this behavior?
Below is the code I’m using.

export function iconButton10_click(event) {
//Add your code for this event here:
$w(“#iconButton10”).link = “tel:” + $w(“#input6”).value
}