-
Notifications
You must be signed in to change notification settings - Fork 550
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Non-scrollable but expandable editor #150
Comments
This is not supported as of now, but is a good feature request. If you would like to give it a try I'd recommend looking at To allow expandable behavior we'd need to replace scrollable view with some our layout widget which is able to introspect into heights of its children. Not sure if Flutter comes with a widget that allows is, but a good starting point would be to look how Flutter's expandable text field implements this behavior and try to mimic it here. It could be a bit trickier with Zefyr though, since Flutter's editable text field backed by a single render object ( |
Investigating... Removing the |
dirty version here: cgestes@d7a37bb @pulyaevskiy I can submit a PR if you give me some direction about how you would like this to be integrated (new widget?), this codebase is still too new for me.. :D |
Feel free to submit a PR. There are a couple more things that we'll need before we can land this change:
I feel like for both points it would be a good idea to standardize on something like There is one edge case though: this way editor will grow indefinitely which may not be desirable. So These are my initial thoughts. We can definitely just start from |
sorry just noticed your comment now. I will try to submit a PR when I refactor my code. :) |
@cgestes any update on this? |
I use this for now: cgestes@00ff6e6 I still didn't do a pass on it. It is not ready for a PR yet, but it works for me ! |
I think #50 and this issue are asking for the same thing. I'm also not sure having min/max height properties is the right way to go as that's usually done through an outer Also @cgestes any updates? I tried using your fork but I'm getting this error when pub tries to installs
It'd be nice to have a quick fix out there for anyone who wants it |
Hmm @Nolence could you maybe share more context of your pubspec.yaml? |
|
I'm sorry for late reply, @CanRau I was just doing
Yeah, I ended up doing the same thing as you and forked cgestes repo and just changed the |
(added an expandable parameter to make it configurable) just do |
Awesome work @cgestes! One thing, I tried your repo (similar to how I did above) both on dev and stable but I keep getting this: Compiler message:
../../flutter/.pub-cache/git/zefyr-1182804cede55171f35a00cf7c917c2c2029c21a/packages/zefyr/lib/src/widgets/editable_box.dart:332:12: Error: The method 'getSelectionRebase' isn't defined for the class 'RenderEditableBox'.
- 'RenderEditableBox' is from 'package:zefyr/src/widgets/editable_box.dart' ('../../flutter/.pub-cache/git/zefyr-1182804cede55171f35a00cf7c917c2c2029c21a/packages/zefyr/lib/src/widgets/editable_box.dart').
Try correcting the name to the name of an existing method, or defining a method named 'getSelectionRebase'.
return getSelectionRebase(nodeBase, nodeExtent, documentSelection);
^^^^^^^^^^^^^^^^^^
../../flutter/.pub-cache/git/zefyr-1182804cede55171f35a00cf7c917c2c2029c21a/packages/zefyr/lib/src/widgets/editable_box.dart:339:12: Error: The method 'selectionIntersectsWith' isn't defined for the class 'RenderEditableBox'.
- 'RenderEditableBox' is from 'package:zefyr/src/widgets/editable_box.dart' ('../../flutter/.pub-cache/git/zefyr-1182804cede55171f35a00cf7c917c2c2029c21a/packages/zefyr/lib/src/widgets/editable_box.dart').
Try correcting the name to the name of an existing method, or defining a method named 'selectionIntersectsWith'.
return selectionIntersectsWith(base, extent, selection);
^^^^^^^^^^^^^^^^^^^^^^^ Any ideas? |
missing import. pushed the fix. (sorry I try to keep the master branch clean, but I never use it) |
This is now possible in |
Is there a way to let ZefyrEditor expand downward as user type?
For example, I can achieve this behavior with TextField Widget by wrap it in a LayoutBuilder and set the maxline parameter to null:
I tried the wrap ZefyrEditor in a LayoutBuilder, and the editor simply not showing. If it is not possible, and I want to fork and work on it, where should I start?
The text was updated successfully, but these errors were encountered: