flutter_widget_from_html icon indicating copy to clipboard operation
flutter_widget_from_html copied to clipboard

Custom widget when using with InlineCustomWidget is causing custom widget partially clickable/hover.

Open vishal0768 opened this issue 1 year ago • 6 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 tap on custom component when using InlineCustomWidget no matter what is the size of the the custom widget, it should not block tappable area of it.

Actual results

it is not allowing to tap on half of the portion of the custom component when using InlineCustomWidget no matter what is the size of the the custom widget, it blocks half of its width when coming at the start of the sentence.

vishal0768 avatar Nov 12 '24 11:11 vishal0768

The expected results look reasonable. However, your issue description is missing the HTML. Also, can you provide a minimal version of component for testing?

daohoangson avatar Nov 13 '24 01:11 daohoangson

@daohoangson thanks for your reply, I have edited the above template, please have a look and let me know if need more info. I tried to keep it simple.

vishal0768 avatar Nov 13 '24 08:11 vishal0768

@daohoangson Also with this custom widget builder, I am getting another issue when the HtmlWidget is wrapped with SelectionArea() widget which is shown in example of the package as well, but that makes it harder to select the text properly when you have custom widget inside the html and you start to drag horizontally. this works fine when there is no custom widget is there in the html.

Let me know if need to raise another bug for this, but keeping it here for now because it seems related to me.

vishal0768 avatar Nov 13 '24 08:11 vishal0768

Hi @daohoangson Any updates over this? we have integrated this into a very big product and we have large customer base, and we are using this library from a very long time, everything is setup and is working smoothly but as i mentioned above two bugs are causing our product a bad user experience sometimes, Kindly have a look at this on priority and let me know if you're planning to release any version soon, we can wait and share the timeline to client, also if you can provide any solution to make the text selection working correctly by using some custom code until you update the new version please do let me know, we are struggling with this issue from a long time and if it takes more time, we might need to switch to some other approach and that will be a huge time consuming task.

vishal0768 avatar Dec 10 '24 13:12 vishal0768

let me know if need to raise separate bug for text selection issue in the custom widget case @daohoangson

vishal0768 avatar Dec 10 '24 13:12 vishal0768

any updates over this? @daohoangson we are about to remove the functionality and uses by this package in future, if this is not resolved, as this is causing lot of issues to out product. kindly try to fix this and revert.

vishal0768 avatar Jan 31 '25 10:01 vishal0768