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

Omit ignoreActiveValue: true Morph option #1195

Merged
merged 1 commit into from
Feb 21, 2024

Conversation

seanpdoyle
Copy link
Contributor

Closes #1194
Rolls back #1141

Don't pass the ignoreActiveValue: true option when Morphing. To restore that behavior, applications can set [data-turbo-permanent] when form control receives focus (through a focusin event listener), then remove it if necessary when the form control loses focus (through a focusout event listener).

Closes [hotwired#1194][]
Rolls back [hotwired#1141][]

Don't pass the `ignoreActiveValue: true` option when Morphing. To
restore that behavior, applications can set `[data-turbo-permanent]`
when form control receives focus (through a `focusin` event listener),
then remove it if necessary when the form control loses focus (through a
`focusout` event listener).

[hotwired#1141]: hotwired#1141
[hotwired#1194]: hotwired#1194
Copy link
Member

@jorgemanrubia jorgemanrubia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot @seanpdoyle 🙏

@jorgemanrubia jorgemanrubia merged commit 3a8e2d9 into hotwired:main Feb 21, 2024
1 check passed
@seanpdoyle seanpdoyle deleted the rollback-1141 branch February 21, 2024 15:39
weaverryan added a commit to symfony/ux that referenced this pull request Feb 27, 2024
…erryan)

This PR was merged into the 2.x branch.

Discussion
----------

[Live] Reverting ignoreActiveValue: true in Idiomorph

| Q             | A
| ------------- | ---
| Bug fix?      | yes/no
| New feature?  | yes/no <!-- please update src/**/CHANGELOG.md files -->
| Issues        | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License       | MIT

This setting was recently reverted in Turbo (hotwired/turbo#1195). By setting this to true, it makes it impossible to update the active input's value with a new value from the server (see hotwired/turbo#1194).

I had used this to fix a cursor position bug. We now fix it in a different way.

Cheers!

Commits
-------

a15740e [Live] Reverting ignoreActiveValue: true in Idiomorph
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Morphing: impossible to "clear" a form due to ignoreActiveValue: true
2 participants