Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call Inputfield::renderReadyHook earlier so that hooks can set the collapsed state #532

Open
Toutouwai opened this issue Jul 25, 2024 · 0 comments

Comments

@Toutouwai
Copy link

Short description of the enhancement

I expected the collapsed state of an inputfield to be a part of the rendering of the inputfield, and so would be possible to set in a hook before Inputfield::renderReadyHook.

But this hook is called after InputfieldWrapper has already determined if the field will be AJAX-loaded or not, so it's not possible to achieve an AJAX-loaded inputfield by setting the collapsed property in a hook to Inputfield::renderReadyHook.

See these lines before $inputfield->renderReady() which in turn calls renderReadyHook().

If there are no unwanted side-effects, could $inputfield->renderReady() please be called before the AJAX-loading of an inputfield is determined so there's an opportunity to set it in a hook?

I know that InputfieldWrapper::renderInputfield is hookable but a hook to that will be triggered a great many times throughout the admin whereas a hook to renderReadyHook can be for an individual inputfield type, so there's less overhead (I think).

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

No branches or pull requests

1 participant