flutter_widget_from_html icon indicating copy to clipboard operation
flutter_widget_from_html copied to clipboard

using customWidgetBuilder is causing text selection issue with `InlineCustomWidget` and `Inkwell` inside

Open vishal0768 opened this issue 1 year ago • 1 comments

Steps to Reproduce

HTML
<customTag inline='true'>name=test_name</customTag> some text here
`HtmlWidget` configuration
Widget _htmlWidget(String string) {
    return HtmlWidget(
      string,
      customStylesBuilder: (element) => _styleSheet(element),
      customWidgetBuilder: (element) => _widgetBuilder(element),
      onTapUrl: _onTapUrl,
    );
  }
 Widget? _widgetBuilder(dom.Element element) {
    switch (element.localName) {
      case 'customTag':
        return return InlineCustomWidget(child: InkWell(onTap: ()=>print('clicked'), child:Text('2'))); // this component is tappable and opens a dialog on tap of it using Inkwell inside.
    }
    return null;
  }
Testing on chrome browser

Expected results

it should allow to select the text when using InlineCustomWidget no matter what is the size of the the custom widget, it should not block text selection it.

Actual results

it is not allowing select the text when using InlineCustomWidget and inside it when we use Inkwell or GestureDetector no matter it blocks text selection when doing in horizontal direction, for example; try to select one line of text, it is very hard to select, and if we don't use the custom widget in html renderer, it allows to select, so something is around Inkwell or InlineCustomWidget

vishal0768 avatar Dec 11 '24 05:12 vishal0768

This is probably a limitation with Flutter text selection mechanism. Does it work without InkWell widget?

daohoangson avatar Jan 29 '25 04:01 daohoangson