Back to Four Js Website
Four Js Customer Forum
Subscribe for automatic updates:
RSS
Sign in for full access
|
Help
Four Js Development Tools Forum
>
Discussions by product
>
Genero BDL
>
Double click, and right click, on an SVG element
Most recent posts
Pages: [
1
]
« previous
next »
Reply
|
Print
Author
Topic: Double click, and right click, on an SVG element (Read 13290 times)
Phil R.
Posts: 4
Double click, and right click, on an SVG element
«
on:
November 10, 2020, 12:50:32 pm »
Hi,
Can we configure an SVG element so that when we right click on it the menu that is displayed is the same as for a normal form element i.e. the actions with contextMenu="yes".
Also, how do we detect double click on an SVG element, to allow us to trigger an action e.g. edit the element in question.
Thanks,
Phil
Sebastien F.
Posts: 545
Re: Double click, and right click, on an SVG element
«
Reply #1 on:
November 10, 2020, 02:16:35 pm »
Hello,
Are you implementing your own WEBCOMPONENT with SVG inside HTML, or do you use the FGLSVGCANVAS solution?
Seems that double-click events can be detected with SVG onclick event, by check the evt.detail content for number of clicks.
As basis, see FGLDIR/webcomponents/fglsvgcanvas/fglsvgcanvas.html (it implements simple mouse clicks).
For right-mouse clicks, I cant tell.
All of this needs further investigation.
=> Please open a support case.
Seb
Phil R.
Posts: 4
Re: Double click, and right click, on an SVG element
«
Reply #2 on:
November 10, 2020, 03:33:45 pm »
Hi Seb,
We're using FGLSVGCANVAS, with that webcomponent in an existing form.
Thanks for the tip re the double-click.
Regards,
Phil
Sebastien F.
Posts: 545
Re: Double click, and right click, on an SVG element
«
Reply #3 on:
November 10, 2020, 04:36:38 pm »
Ok if you are using FGLSVGCANVAS then it could be enhanced to support double clicks...
As I wrote please contact your support for the request.
Seb
Sebastien F.
Posts: 545
Re: Double click, and right click, on an SVG element
«
Reply #4 on:
November 10, 2020, 06:48:12 pm »
Phil,
I have started to look at this in our FGLSVGCANVAS solution...
It appears that SVG onclick reacts on double click, and that seems to work with the current FGLSVGCANVAS code.
What is missing is some additional information in the field value, to distinguish simple clicks from double-clicks (event.detail)
We will work on this.
But if you only want to react on double-click, just give it a try (same ON ACTION will be fired) => click or double-click is the same for now.
Reacting on right-click is another story, this depends on the web content viewer / browser...
Seb
Sebastien F.
Posts: 545
Re: Double click, and right click, on an SVG element
«
Reply #5 on:
November 10, 2020, 08:37:13 pm »
In fact, with FGLSVGCANVAS:
Each click will fire an action without any timeout/delay, so when user double-clicks on an SVG element, you get twice the action in the dialog code.
In the FGLDIR/demo/webcomponents/svgbasics demo, add a display below ON ACTION item_selection to see how it reacts...
So you can't make a diff between a regular click or double-click.
=> Must review FGLSVGCANVAS to properly support double clicks => WCG-152
Seb
Phil R.
Posts: 4
Re: Double click, and right click, on an SVG element
«
Reply #6 on:
November 11, 2020, 10:56:31 am »
Coincidentally, we do already check in ON ACTION item_selection to see when that action was last triggered, and which element it was. If it is the same element, and less than a second ago, we assume a double click. but it's all our own code, and it doesn't do the trick 100%.
So yes, an enhancement to FGLSVGCANVAS would be wonderful.
Thanks Seb!
Sebastien F.
Posts: 545
Re: Double click, and right click, on an SVG element
«
Reply #7 on:
November 11, 2020, 03:56:38 pm »
Hello Phil,
Please if not done yet open a support request so we can properly track this.
Seb
Phil R.
Posts: 4
Re: Double click, and right click, on an SVG element
«
Reply #8 on:
November 11, 2020, 03:59:07 pm »
Coincidentally I'm working on it right now!
Pages: [
1
]
Reply
|
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General
-----------------------------
=> General Discussion
=> Ask Reuben
=> WWDC21
-----------------------------
Discussions by product
-----------------------------
=> Products announcements
=> Genero BDL
=> GWS
=> GAS and GBC
=> GDC
=> Genero Mobile for Android or iOS
=> Genero Studio
=> Reporting tools (GRW, GRE)
-----------------------------
Jobs
-----------------------------
=> Jobs
Powered by SMF 1.1.21
|
SMF © 2015, Simple Machines
Loading...