flutter-code-editor icon indicating copy to clipboard operation
flutter-code-editor copied to clipboard

How to detect taps inside of the CodeEditor?

Open Prince2347X opened this issue 1 year ago • 3 comments

I've tried wrapping the CodeEditor in GestureDetector() but it doesn't seem to work and onTap doesn't exist for CodeEditor, I'm wondering what do I need to do to fire a callback when the user taps the CodeEditor region?

Prince2347X avatar May 03 '23 21:05 Prince2347X

Hello! @Prince2347X Please try passing a FocusNode to the CodeField and listening to the focus change events. If you don't need some specific taps like LongPress or DoubleTap, this should work.

yescorp avatar May 05 '23 09:05 yescorp

Okay, Thank you @yescorp, I wrapped the CodeField in TapRegion and it's working. But why onTap is not available for the CodeField widget if it's just wrapped to a TextField? Is there any issue with it or it is planned for future?

Prince2347X avatar May 05 '23 16:05 Prince2347X

Honestly, you guys should fix this one..it's in the default code text field

Somtobro avatar Aug 15 '23 18:08 Somtobro