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

Polaris::SelectComponent not updating when using turbo #433

Open
alhafoudh opened this issue Jul 22, 2024 · 3 comments
Open

Polaris::SelectComponent not updating when using turbo #433

alhafoudh opened this issue Jul 22, 2024 · 3 comments

Comments

@alhafoudh
Copy link

When page content is updated via turbo, Polaris::SelectComponent is not updating it's selectedOption target's innerText. The selectedOption target's innerText is updated only on connect() or change.

Here: https://github.com/baoagency/polaris_view_components/blob/main/app/assets/javascripts/polaris_view_components/select_controller.js#L3

@alhafoudh
Copy link
Author

I found a hot-fix for this. I add ... , input_options: { data: { action: 'turbo:load@window->polaris-select#update' } } to the Polaris::SelectComponent.

Should this behavior be in this library or we should leave it to the developer to handle this case?

@wntechs
Copy link

wntechs commented Sep 19, 2024

I found a hot-fix for this. I add ... , input_options: { data: { action: 'turbo:load@window->polaris-select#update' } } to the Polaris::SelectComponent.

Should this behavior be in this library or we should leave it to the developer to handle this case?

I also face the similar issue. Not sure why it is not taken care of yet. @alhafoudh Can you please provide more details about your hot-fix how you resolved this?
Thanks

@wntechs
Copy link

wntechs commented Sep 27, 2024

I found a hot-fix for this. I add ... , input_options: { data: { action: 'turbo:load@window->polaris-select#update' } } to the Polaris::SelectComponent.
Should this behavior be in this library or we should leave it to the developer to handle this case?

I also face the similar issue. Not sure why it is not taken care of yet. @alhafoudh Can you please provide more details about your hot-fix how you resolved this? Thanks

I was missing the npm package integration, after I install the related package the issue is resolved.

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

2 participants