WebVisu icon indicating copy to clipboard operation
WebVisu copied to clipboard

mouse click on an object doesn't set the input variable of that object

Open triessner opened this issue 4 years ago • 9 comments

In my visualisation I (mis)use objects (ellipse, rectangle) as buttons. I.e. the ellipse of my pump: Clicking on it, sets a variable to start/stop the pump. I set the variable in the tab mode (German "Variable tasten"). In the java visualisation it works without problems, but not in this javascript visualisation.

triessner avatar Dec 29 '20 09:12 triessner

So you have attached an tap event on the surrounding ellipse on the pump?

tnentwig avatar Dec 29 '20 14:12 tnentwig

I just noticed, that the tap works, when I click in the left half of the pump. It seams, that if I click in the area between the polyline it doesn't work. In the original java version it worked also in this area. I guess if I put the polyline below the ellipse (at the moment it is above the ellipse), it will work in the whole area of the ellipse. I will try in the next days and report again here.

triessner avatar Dec 29 '20 23:12 triessner

Yeah, I know this problem. The events are currently attached at the element itself e.g. the polyline but not the inner space.

tnentwig avatar Dec 30 '20 12:12 tnentwig

As expected, it works without problems when I put the polyline below the ellipse. But I will put it over the ellipse and test, when you address this bug. It seams, that it is a similar problem as the very first issue I reported (Polylines draw triangles in the angles). I suppose the triangles aren't visible any more, but are still receiving the mouse click.

triessner avatar Jan 07 '21 16:01 triessner

~~I see. I will try something.~~ Edit: Ok i have found the right way to do this, dev repo updated.

Ekristoffe avatar Jan 08 '21 00:01 Ekristoffe

I've tested the new release 1.0.13-3, and there it still doesn't work. Maybe your fix didn't find its way to the new version? Now, with the cursor showing when it is over a clickable item, it is quite obvious: When the cursor moves over the (invisible) triangle of a polyline, it changes its form and indicates, that there is no clickable item below it.

triessner avatar Jan 29 '21 17:01 triessner

I think this could be fixed by usage of "pointer-event: visible" only on visible elements and otherwise "pointer-event: none" at the surrounding div. Was this your attempt too, Chris?

tnentwig avatar Feb 10 '21 20:02 tnentwig

Normally yeas but I have found some strange thing with the pointer event system. I am thinking to check and redo the object. I will have a big restructuration idea but It take time (every object need to be checked one by one and remake)

Ekristoffe avatar Feb 11 '21 07:02 Ekristoffe

I think a quick fix woul be to set the pointer-events to "all". Would roughly correspond to the codesys visualization.

tnentwig avatar Jul 24 '21 10:07 tnentwig