Skip to content
This repository has been archived by the owner on Jan 20, 2023. It is now read-only.

Add an x-init call on the views #7

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

joearcher
Copy link

To set an initial count value when the field already has content on page load.

To set an initial count value when the field already has content.
@martin-ro
Copy link
Owner

Thanks for the PR @joearcher.

Does the field not show the initial count when it already has content for you?
Because $refs.countInput.value.length is already called on the wrapper and your PR would just add the same code again. Might be something else that breaks the initial count for you.

@joearcher
Copy link
Author

I don't get a char count on page load until a character is added into the field, it just sits at 0/{max}. This was the only way I could find to make it work.

I'm using the forms package independently of the main filament admin package if that makes any difference (I can't see how it would) filament/forms is at v2.15.18

No console errors or anything, it just acts like the initial count never happens.

@martin-ro
Copy link
Owner

Yeah, might be because you're using it outside of filament. I can't think of why it wouldn't work either. I will investigate after the weekend.

@joearcher
Copy link
Author

I just did a little testing and used this package on a local install of filament admin I have, I can confirm that this works as expected when used as part of a filament admin resource, but not when using filament/forms independently.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants