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

Problem using the SuperEditor with a TabBar #501

Closed
hillelcoren opened this issue Mar 28, 2022 · 4 comments · Fixed by #708
Closed

Problem using the SuperEditor with a TabBar #501

hillelcoren opened this issue Mar 28, 2022 · 4 comments · Fixed by #708
Assignees

Comments

@hillelcoren
Copy link

hillelcoren commented Mar 28, 2022

When adding the editor to a TabBarView once the screen is filled with text the TabBarView automatically changes to the next tab rather than scroll down in the editor.

A related problem is when the editor is used on mobile in a TabBarView if the keyboard is shown it causes the tab bar to change to the previous tab.

Here's a simple example:

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        bottom: TabBar(
          controller: _controller,
          tabs: [
            Tab(
              text: 'Tab 1',
            ),
            Tab(
              text: 'Tab 2',
            ),
          ],
        ),
      ),
      body: TabBarView(
        controller: _controller,
        children: [
          ExampleEditor(),
          ExampleEditor(),
        ],
      ),
    );
@matthew-carroll
Copy link
Contributor

@hillelcoren can you provide a video of these two bugs in action? I'm not entirely sure what you're describing.

@hillelcoren
Copy link
Author

I've retested using the editor in tabs, I'm no longer able to reproduce the issue above but I'm seeing this error in the console.

════════ Exception caught by scheduler library ═════════════════════════════════
The following assertion was thrown during a scheduler callback:
ScrollController not attached to any scroll views.
'package:flutter/src/widgets/scroll_controller.dart':
Failed assertion: line 107 pos 12: '_positions.isNotEmpty'


When the exception was thrown, this was the stack
#2      ScrollController.position
#3      _AndroidDocumentTouchInteractorState.scrollPosition
#4      _AndroidDocumentTouchInteractorState._updateScrollPositionListener
#5      _AndroidDocumentTouchInteractorState.initState.<anonymous closure>
#6      SchedulerBinding._invokeFrameCallback
#7      SchedulerBinding.handleDrawFrame
#8      SchedulerBinding._handleDrawFrame
#12     _invoke (dart:ui/hooks.dart:151:10)
#13     PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:308:5)
#14     _drawFrame (dart:ui/hooks.dart:115:31)
(elided 5 frames from class _AssertionError and dart:async)
════════════════════════════════════════════════════════════════════════════════

════════ Exception caught by scheduler library ═════════════════════════════════
ScrollController not attached to any scroll views.
'package:flutter/src/widgets/scroll_controller.dart':
Failed assertion: line 107 pos 12: '_positions.isNotEmpty'

════════════════════════════════════════════════════════════════════════════════

════════ Exception caught by scheduler library ═════════════════════════════════
ScrollController not attached to any scroll views.
'package:flutter/src/widgets/scroll_controller.dart':
Failed assertion: line 107 pos 12: '_positions.isNotEmpty'

════════════════════════════════════════════════════════════════════════════════

════════ Exception caught by scheduler library ═════════════════════════════════
ScrollController not attached to any scroll views.
'package:flutter/src/widgets/scroll_controller.dart':
Failed assertion: line 107 pos 12: '_positions.isNotEmpty'

════════════════════════════════════════════════════════════════════════════════

════════ Exception caught by rendering library ═════════════════════════════════
A RenderFlex overflowed by 18 pixels on the bottom.
The relevant error-causing widget was
SuperEditor
════════════════════════════════════════════════════════════════════════════════

@matthew-carroll
Copy link
Contributor

@hillelcoren is that problem caused by the widget tree you originally posted? Does it happen immediately upon loading the UI?

@hillelcoren
Copy link
Author

Yes, this is trigged by the widget tree above.

The error occurs when I type into the super editor enough lines of text to get to the bottom of the screen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants