F
Filament3mo ago
SirFat

Password (and other fields) truncates themselves on screen (possibly due to live())

Hi, I'm after some guidance on how best to debug this. When entering a password (or some text inputs) the field appears to auto-truncate itself. I can see it performing an 'update' AJAX call at the same time it occurs. I thought it was just me, but people helping test have seen it as well (see https://internal-development.asmorphic.com/ (register). I have upgraded, cleared all caches, put it in production mode but I experience the same symptom. The password field is basically the vanilla register field with strength detection from the Laravel Daily team.
->live()
->password()
->label(__('filament-panels::pages/auth/register.form.password.label'))
->required()
->rule(Password::default())
->dehydrateStateUsing(fn ($state) => Hash::make($state))
->same('passwordConfirmation')
->revealable(filament()->arePasswordsRevealable())
->validationAttribute(__('filament-panels::pages/auth/register.form.password.validation_attribute'))
->afterStateUpdated(function ($state, Set $set) {
if (empty($state)) {
return;
}
$score = (new Zxcvbn())->passwordStrength($state)['score'];
$set('strengthScore', $score);
$this->dispatch('update-score', score: $score);
}
->live()
->password()
->label(__('filament-panels::pages/auth/register.form.password.label'))
->required()
->rule(Password::default())
->dehydrateStateUsing(fn ($state) => Hash::make($state))
->same('passwordConfirmation')
->revealable(filament()->arePasswordsRevealable())
->validationAttribute(__('filament-panels::pages/auth/register.form.password.validation_attribute'))
->afterStateUpdated(function ($state, Set $set) {
if (empty($state)) {
return;
}
$score = (new Zxcvbn())->passwordStrength($state)['score'];
$set('strengthScore', $score);
$this->dispatch('update-score', score: $score);
}
6 Replies
awcodes
awcodes3mo ago
Probably need to debounce the live() or make it onBlur. What’s happening is common in livewire with slow requests. The user is typing faster than the request can come back so the dom dif wipes out anything since the request was sent. For this use case I would recommend->live(onBlur: true) That way the request will only be made when the field looses focus.
SirFat
SirFat3mo ago
Hey - Great to hear from you! I had a feeling you may mention onBlur. I will give it a go.
awcodes
awcodes3mo ago
Not sure if it’s intended or not, but the strength meter is animating from load. At least on my phone. By head says it should be hidden until the user puts in a password, but may not be the requirement for the app. 🙂
SirFat
SirFat3mo ago
I just copied filamentexamples.com - I just have some wholesale shifting of the service registration and then i'll be doing some house keeping yeah makes sense to me, presumably I'd just use hidden(fn .. for that
awcodes
awcodes3mo ago
No worries. Just pointing it out. Cheers.
SirFat
SirFat3mo ago
Appreciate it as always
Want results from more Discord servers?
Add your server
More Posts
How can I apply a class to fi-fo-field-wrp?have a grid, and I'm supplying extra attributes, but it's going to the parent grid (obviously) and iis that possible to sum 2 columns in tableHi i want to make new column that sum 2 columns in laravel filament, is that possible? Thank you!Filament resource for MarkableI'm using [this](https://github.com/maize-tech/laravel-markable) package. It works well however I woUncaught (in promise) Component not foundI have a delete action on my livewire component., which is an edit modal/slideover. It's working finTextArea with autosize resets to default size with Live event.Before I report this as a bug, I'd like to know if this is expected behaviour. I have a very simplesetting a custom homeUrl after login doesn't seem to worki have a new panel created and set the `homeUrl('calendar')` but everytime I login on the new panel,Wizard Form Layout with Multiple and Nested RepeaterHi all, I want to make my online course website. Anyone have a tutorial or best practice suggestionsRich Editor is very slow while using images inside the content how can I speed up that?I have a website that have a blogs system while I'm using the rich editor it's very slow with the biNeed assistance with arranging two sections side by side in Filament PHP formI'm currently working on a project using Filament PHP and I have a scenario where I need to display How to get data repeater in handleProcessCreation() method ?I have accessed array $data variabel, and repeater datas not included in this data. How I can get re