Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Strangest bug ever? TreeGrid.deselectAllRecords() causes SVG image to disappear!

    I know, it sounds like the Loch Ness monster, but hear me out.

    This is a bug that only occurs on mobile, and specifically in the Safari browser (tested on the latest IOS version, iPhone 14 pro, as of today)

    Consider the test case below with a split pane.

    It has a tree to the left with an SVG image above it. When you click the tree, you come to a detail pane with a back button. When you press it, you get back to the nav pane.
    I use showDetailPane() and showNavigationPane(), standard fare.

    However - when I call deselectAllRecords on the tree as you can see in the click handler for the backbitten - the SVG disappears! Crazy stuff.

    if I just call showNavigationPane() it works.
    If I instead call deselectRecord(0), it also works.
    It works with another file format, but it also seems to work with the regular GWT image.

    Please tell me I'm not seeing things.

    EDIT: my current workaround...:
    Code:
    TreeNode selectedRecord = tree.getSelectedRecord();
    int i = tree.getTree().indexOf(selectedRecord);
    tree.deselectRecord(i);

    code for test case:
    Code:
    public void onModuleLoad() {
            SplitPane splitPaneMain = new SplitPane();
            splitPaneMain.setShowDetailToolStrip(false);
            splitPaneMain.setShowNavigationBar(false);
            splitPaneMain.setWidth100().setHeight100();
    
            TreeGrid navigationTreeGrid = new TreeGrid();
    
            Tree navigationTree = new Tree();
            navigationTreeGrid.setShowHeader(false);
            navigationTree.setData(new TreeNode[]{new TreeNode("Hello")});
            navigationTreeGrid.setData(navigationTree);
            navigationTreeGrid.addClickHandler(event -> {
                splitPaneMain.showDetailPane();
            });
    
            VLayout navigationLayout = new VLayout();
            navigationLayout.setBackgroundColor("blue");
    
    
            Img logo = new Img("nuba_l.svg", 130, 36);
            logo.setAlign(Alignment.CENTER);
            logo.setLayoutAlign(Alignment.CENTER);
    
            Label label = new Label("Hello");
            label.setBackgroundColor("white");
    
            navigationLayout.addMember(label);
            navigationLayout.addMember(logo);
    
            navigationLayout.addMember(navigationTreeGrid);
    
            splitPaneMain.setNavigationPane(navigationLayout);
    
            VLayout layoutToolbars = new VLayout();
            layoutToolbars.setMargin(10);
            layoutToolbars.setHeight(50);
            layoutToolbars.setMembersMargin(10);
            ToolStrip toolStripToolsNav = new ToolStrip();
            toolStripToolsNav.setWidth100();
    
            ToolStripButton tsBackButton = new ToolStripButton();
            tsBackButton.setTitle("Back!");
            toolStripToolsNav.addButton(tsBackButton);
            toolStripToolsNav.addClickHandler(event -> {
                splitPaneMain.showNavigationPane();
                navigationTreeGrid.deselectAllRecords();
    
            });
            layoutToolbars.addMember(toolStripToolsNav);
            splitPaneMain.setDetailPane(layoutToolbars);
    
            splitPaneMain.draw();
        }
    Last edited by mathias; 17 Jan 2023, 01:46.

    #2
    This doesn't make much sense and that's not enough to repro the problem, but, the first step in troubleshooting this would be to look at the DOM for the rendered SVG and see if something changes during the operations on the tree / splitpane.

    Comment


      #3
      Why is it not enough to reproduce the problem? When I run the provided test case in an empty project with an SVG image, It happens.

      As I mentioned, I found a workaround, so it's not important to me. I just spend the time working out the test case to help you out.

      Comment


        #4
        It looks like more has been added after the fact - it does look runnable now.

        However, the only workable theory we have for how this would happen would be likely to be a weird interaction between the CSS specific to your project, your specific SVG, or other skin customizations.

        This gives us a very low chance of reproducing the error.

        If you aren’t willing to do basic troubleshooting like looking at what changes in the SVG DOM, then can you at least:

        1. let us know your specific version

        2. share the specific SVG file

        3. (Ideally) see if this reproduced with a stock skin rather than in your environment

        Comment


          #5
          (I have not added anything later, check the edit history)
          Anyway. I have prepared a self-contained skeleton maven project, with everything you need in it(I would hope), including an SVG image (we have tried many, same result for all), just because you're such nice guys!

          It has no references to any css, any skin, any other code. (unless I have missed something, which I don't think). When I run it, I get the same behaviour explained earlier.

          I tried to upload the zip, but it wouldn't let me. Where can I mail it?

          Cheers

          Comment


            #6
            Thanks for preparing all of that - we appreciate it - but as you can see in the text below the input area when you type in a post, we don't do .zips: the whole point is files that drop-in to a standard environment (such as a sample project). This is because full project configs could have dozens of things wrong with them that are not related to our software, such as inadvertently included dependencies we can't download, stale versions, references to local resources you forgot to remove, IDE config that only works for you - it's a very long list.

            We already have complete code here that (in theory) drops into a standard environment. So again all that is needed are the 3 points above: version, SVG file and [already fulfilled] letting us know that you tested against a standard skin.

            You could post the SVG file here, or a URL to it, or if for some reason that's difficult (like it's confidential) you could email it to support@isomorphic.com.

            Comment


              #7
              Gotcha about the zip. Have mailed it now anyway, hope you'll find some use for it still. It should be completely stand-alone. Cheers!

              Comment

              Working...
              X