I am trying to create a custom component that allows to show a form on top of the rest of the page and behave like a context menu. Long time ago I asked this question. I got some interesting feedback, but I never used it until now.
Here is what I have done:
https://anvil.works/build#clone:PCDJ4YL7ROKELNIM=6B3EORIHWX7HVODS35IEYWKA
It is promising, but I still have a few questions:
-
When I click on the
Open me again
button, another fixed form is shown. The new form works well, but theonmouseleave
event of the first form stops working.
Why does the listener of the first form stop working? -
I have used a
CustomHTML
form with as little HTML as possible, just enough to identify it from javascript and to be able to contain an Anvil form. I also added aLabel
with a unique text that allows me to identify this specific instance from javascript.
Is the custom form HTML correct? -
The fixed form has no margins on the sides and a little margin on top and bottom; the area between the form and the border is transparent and I don’t like it.
What is the right way to manage the border?