They are new enough that they have not made it into the docs yet, as far as I know. However, very little documentation is required.
They are exactly the same as the regular actions so any configuration for the regular actions applies to the taphold actions and this also means you can just use the action documentation under any of the standard action components.
Using the MainUI widget editor, ctrl + space, under a config heading brings up the available options and you will see them and all the sub-options listed for the components where you can use them.
I have actually tried in oh3.4 to implement the taphold action but nothing happens.
The syntax is accepted, but when I keep pressed the cell nothing happens.
Here’s the yaml code
Edit: Nothing appears in logs.
Edit 2: possibly it must be enabled somewhere? See link
Edit3: I figured out that taphold is only possible for buttons and cards, not generic cells. The right syntax is written in the docs
Hi @Lionello_Marrelli Did you get anywhere with this? I am trying to taphold_actionPage and navigate elsewhere but I keep just getting the same popup and it’s not navigating.
Slots are not the problem. The two problems are 1) you are trying to use the taphold actions on an oh-label-cell and this function is not available there, 2) even if it were available, you have not completely defined the taphold action, you have only used the taphold_actionPage. Just like with the regular action, you need to actually tell it which kind of action you want it to perform using taphold_action or it won’t know to look for the correct additional properties.
Thanks @JustinG for the kick in the right direction! I’m still messing about finding my way around OH pages.
Just to echo @Lionello_Marrelli about if taphold could be made available for these page cell elements. I am guessing there is something fundamental that doesn’t allow for this?
I tried to follow your suggestions and I obtain a popup offering a button that responds differently to short and long click. Not exactly what happens to cards, but very close.
Is there some other option to set, in order to have the action and taphold action being done immediately?
I think I get what you are suggesting thanks @Oliver2 I just lack to knowledge to apply it. For now, I have found another way, by adding the controls I need into the popup slots from the page I am trying to navigate to.
I know what you mean. I also like the nice style of an expanded card. Then go for oh-label-card which also supports taphold. It is hidden in the advanced config menu.
You have to make sure that your button covers the whole space of the containing cell.
add border: solid 1px red to the button’s style and see where your button is. @JustinG Justin, do you think the button still responds to a tap or tapnhold if it resides in the background slot?
Try also to add height: 100% to the button
Alas, there’s a <div> element that doesn’t have a set height between the card and the button, so height: 100% will not work, you’ll have to make that height: 120px which is the fixed height of the cell.
After several trial and errors I figured out how to correctly implement the suggestions. Let me write it down here for future reference for those who will happen to come to this thread.
A note of warning: while randomly adding an --f7-button-height in a wrong section, it turned out that the whole ui was not operational anymore. I had to stop openhab and remove the line added from the jsondb/uicomponents_ui_page.json.
Hi all, this long-tap feature looks amazing. I am currently trying to build my own widget and merge this one with a simple-toggle I am using in several use-cases already with a HomeKit-like look:
Those are based on an f7-card. Unfortunately I couldn’t make the above work with an f7-card (background does not work properly). On the other hand the oh-cell seems to be limited in regards to default slots that are shown. When using the below code it looks good initially, but does not take the default slots into account at all and the Cell has no text or icons, while the background slot still works. Does anyone have a clue why this is the case?
The oh-cell is based on the f7-card but, as with al of the oh- type components, it’s been highly modified to be usable in a “low code”. This means that the configurations are completely different. To see how this might work with the f7-card you can check out the f7 docs:
With the oh-cell the default slot has been reconfigured to place components only on the area of the card that becomes visible when you expand the card.
Thanks for the swift reply, that’s what I thought.
I ended up not using an f7-card, but the oh-button directly.
I guess it matches the requirements of the above as well, but without having a cell and a button in the background. Short and long tap are working quite well: