re-editor icon indicating copy to clipboard operation
re-editor copied to clipboard

Bug with Cursor Movement in iPhone Safari

Open mycalls opened this issue 1 year ago • 1 comments

  1. Run the sample code in Safari on an iPhone.
  2. Moving the cursor causes the character before the cursor to be deleted.
import 'package:flutter/material.dart';
import 'package:re_editor/re_editor.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: const MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key});

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

final _initialText =
    List.generate(500, (int index) => '${index + 1} abcde').join('\n');

class _MyHomePageState extends State<MyHomePage> {
  final _controller = CodeLineEditingController.fromText(_initialText);

  @override
  void dispose() {
    _controller.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('re_editor smaple'),
      ),
      body: CodeEditor(
        controller: _controller,
      ),
    );
  }
}

Screenshots https://github.com/user-attachments/assets/6df245ed-1815-4f6f-87a1-ff522152d69f

Device:

  • OS: iOS
  • Version 18.2

mycalls avatar Dec 31 '24 08:12 mycalls

I've also noticed this bug on android when testing the behaviour in the reqable app for #71

hommes-doutant avatar Mar 19 '25 13:03 hommes-doutant