-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Resize observer #5095
Resize observer #5095
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #5095 +/- ##
==========================================
+ Coverage 86.60% 86.62% +0.02%
==========================================
Files 555 555
Lines 42931 42996 +65
Branches 6697 6709 +12
==========================================
+ Hits 37181 37247 +66
+ Misses 5750 5749 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
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.
lgtm. you could probably improve test coverage a bit, since there are come uncovered lines, but overall looks good.
@@ -66,9 +66,7 @@ exports.edit = function(el, options) { | |||
onResize: editor.resize.bind(editor, null) |
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.
can we remove onResize
from env
here? I see that it's used in doc site https://github.com/ajaxorg/ace/blob/master/doc/site/js/main.js#L158
can we rely on new functionality, introduced in this PR, in that place as well, instead of manually calling onResize?
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.
Good point, we can remove it from main.js, but i am not sure about env.onResize, because on one hand it is a breaking change, but on other hand it is obscure api.
9416319
to
c083800
Compare
c083800
to
51d5e4d
Compare
Got the coverage to 100% |
Thanks for this ❤️ ! This will allow me to remove some ugly code from my code base that existed solely to call |
[Ace added a `ResizeObserver`][pr-5095] to automatically perform resizes as needed, so we can remove our junk — hooray! [pr-5095]: ajaxorg/ace#5095
users too often forget to call editor.resize after changing the size of the editor.
Since ResizeObserver is now supported on all browsers we can check for size changes ourselves.
I have added an option in case someone needs more fine grained control over resize during the animations.
includes #5094 to use the dialog in kitchen-sink added by it.