-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Feature/54464 snappier progress popover #15383
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1f10742
to
7b62365
Compare
7b62365
to
c4ffc69
Compare
// TODO: Ideally morphing in this single controller should not be necessary. | ||
// Turbo supports morphing, by adding the <turbo-frame refresh="morph"> attribute. | ||
// However, it has a bug, and it doesn't morphs when reloading the frame via javascript. | ||
// See https://github.com/hotwired/turbo/issues/1161 . Once the issue is solved, we can remove | ||
// this code and just use <turbo-frame refresh="morph"> instead. | ||
this.frameMorphRenderer = (event:CustomEvent<TurboBeforeFrameRenderEventDetail>) => { | ||
event.detail.render = (currentElement:HTMLElement, newElement:HTMLElement) => { | ||
morphdom(currentElement, newElement, { childrenOnly: true }); | ||
Idiomorph.morph(currentElement, newElement, { ignoreActiveValue: true }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well well well... Seems they've thought of this already 😆
aaron-contreras
approved these changes
Apr 25, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice @ulferts !
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
TODO
applieddata-turbo-permanent
attribute on focused field in the progress popover and prevented a DOM element with such an attribute from being updated. This prevents inputs from being eaten up.Using an attribute is in line with how Turbo does it so once the Turbo-bug on js triggered frame updates is fixed, it should still work out of the box.
That path was abandoned again as idiomorph has a flag to be passed in when morphing
ignoreActiveValue
which, while documentation is sparse, seems to provide the behaviour we want out of the box.turbo:before-frame-render
from setup.ts. It is only necessary for js triggered updates in the preview controller and not on a general level.https://community.openproject.org/wp/54464