When I add double tab event at viewer on mobile phone, I will get a larger of errors

Describe Your Question

The current version does not support the function of double-clicking to enlarge the viewport on the mobile terminal. I used a double tap to achieve it, but the experience is not good, sometimes not work. You must click once before double-clicking to be effective…

double touch

What steps can we follow to reproduce the bug?

in platform/viewer/src/components/ViewportGrid.tsx file

      const onDoubleTab = (event) => {
        onInteractionHandler(event);
        commandsManager.run({
          commandName: 'toggleOneUp',
          commandOptions: {}
        });
      }

<ViewportPane
          key={viewportId}
          acceptDropsFor="displayset"
          onDrop={onDropHandler.bind(null, viewportIndex)}
          onInteraction={onInteractionHandler}
          onTouchEnd={detectDoubleTapClosure(onDoubleTab)}
          customStyle={{
            position: 'absolute',
            top: viewportY * 100 + 0.2 + '%',
            left: viewportX * 100 + 0.2 + '%',
            width: viewportWidth * 100 - 0.3 + '%',
            height: viewportHeight * 100 - 0.3 + '%',
          }}
          isActive={isActive}
        >

I have fixed this issue, You need disabled pointer-events css, then double touch other view can good work.

1 Like

Hi @webxzy! Is there a place where this “mobile style” viewport grid (top-bottom) can be activated/added in ohif-viewer code? Is it easy to enable it? I have no such option in master branch that I checked out.
Thank you for your time!

Hello @urosch and welcome to OHIF!

The dimensions of the grid that can be changed to can be set for the layout selector tool configuration here. So perhaps 3 rows and 1 column might be best for mobile. If instead the desire is for the initial view to be something more mobile-friendly, then creating a custom hanging protocol should be considered: Module: Hanging Protocol | OHIF

1 Like

Hello @webxzy ,

How are you ?

Do you can share with me this mobile code? I’m looking for to use here.

Rgds