Skip to content

Commit b4540b6

Browse files
committed
Bug Fixed: Tel Input re-rendering after component update in Livewire 3.
1 parent 3916d2a commit b4540b6

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

public/js/laravel-tel-input.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

resources/js/laravel-tel-input.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -278,17 +278,23 @@
278278

279279
// Listen to the document events and re-render the tel inputs
280280
document.addEventListener("DOMContentLoaded", function() {
281-
renderTelInput();
281+
setTimeout(function () {
282+
renderTelInput();
283+
}, 5);
282284

283285
// user dispatched browser events to re-render the tel inputs
284286
document.addEventListener("telDOMChanged", function() {
285-
renderTelInput();
287+
setTimeout(function () {
288+
renderTelInput();
289+
}, 5);
286290
});
287291

288292
// Livewire event hook
289293
if (window.Livewire) {
290294
window.Livewire.hook('component.initialized', component => {
291-
renderTelInput();
295+
setTimeout(function () {
296+
renderTelInput();
297+
}, 5);
292298
});
293299
}
294300
});

0 commit comments

Comments
 (0)