Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tap-hold action is triggered multiple times on oh-label-card #1639

Open
hypetsch opened this issue Jan 14, 2023 · 1 comment
Open

tap-hold action is triggered multiple times on oh-label-card #1639

hypetsch opened this issue Jan 14, 2023 · 1 comment
Assignees
Labels
bug Something isn't working main ui Main UI

Comments

@hypetsch
Copy link

The problem

I have an oh-label-card with a tap-hold action opening a popup. When tap-holding the card, the popup is opened multiple times.(Opening additional popups seems to stop as soon as the animation of the first popup moves the popup over the tap-holded card)

Expected behavior

Only one popup should be opened, independently how long you tap-hold the card.

Steps to reproduce

I use the card inside a custom widget, not sure if this affects the behavior...
It is opened inside the openhab android app on a fire tablet.

uid: widget_light_switch_with_popup
tags: []
props:
  parameters:
    - description: Small title on top of the card
      label: Title
      name: title
      required: true
      type: TEXT
    - context: item
      description: Item to control on/off
      label: Item
      name: item_schalter
      required: false
      type: TEXT
    - context: item
      description: Item to control brightness
      label: Item
      name: item_helligkeit
      required: false
      type: TEXT
    - context: item
      description: Color Temperature Item
      name: item_color
      required: false
      type: TEXT
  parameterGroups: []
timestamp: Jan 14, 2023, 11:16:44 AM
component: oh-label-card
config:
  title: =props.title
  action: toggle
  actionItem: =props.item_helligkeit
  actionCommand: ON
  actionCommandAlt: OFF
  icon: "=(items[props.item_helligkeit].state > 0 ? 'material:lightbulb' : 'material:lightbulb_outline')"
  vertical: true
  item: Esstisch
  iconUseState: true
  iconSize: 80
  iconColor: "=(items[props.item_helligkeit].state > 0 ? 'rgb(230,74,25)' : '')"
  label: " "
  taphold_action: popup
  taphold_actionModal: widget:widget_LightControl
  taphold_actionModalConfig:
    item_brightness: =props.item_helligkeit
    item_color: =props.item_color

The popup widget:

uid: widget_LightControl
tags: []
props:
  parameters:
    - context: item
      description: Brightness Item
      label: Brightness Item
      name: item_brightness
      required: false
      type: TEXT
    - context: item
      description: Color Temperature Item
      label: Color Temperature Item
      name: item_color
      required: false
      type: TEXT
  parameterGroups: []
timestamp: Oct 19, 2022, 8:09:48 AM
component: oh-block
config: {}
slots:
  default:
    - component: oh-grid-row
      config: {}
      slots:
        default:
          - component: oh-grid-col
            slots:
              default:
                - component: f7-card
                  config:
                    title: Farbe
                  slots:
                    default:
                      - component: f7-block
                        config:
                          style:
                            align-content: space-between
                            display: flex
                            flex-wrap: wrap
                            justify-content: space-between
                            padding: 20px
                        slots:
                          default:
                            - component: f7-segmented
                              config:
                                style:
                                  width: 100%
                              slots:
                                default:
                                  - component: oh-button
                                    config:
                                      action: command
                                      actionCommand: "0"
                                      actionItem: =props.item_color
                                      active: "=(items[props.item_color].state <= 15) ? true : false"
                                      large: true
                                      outline: true
                                      style:
                                        width: 25%
                                      text: Energie
                                  - component: oh-button
                                    config:
                                      action: command
                                      actionCommand: "30"
                                      actionItem: =props.item_color
                                      active: "=(items[props.item_color].state > 15 && items[props.item_color].state < 45) ? true : false"
                                      large: true
                                      outline: true
                                      style:
                                        width: 25%
                                      text: Konzentrieren
                                  - component: oh-button
                                    config:
                                      action: command
                                      actionCommand: "70"
                                      actionItem: =props.item_color
                                      active: "=(items[props.item_color].state > 45 && items[props.item_color].state < 80) ? true : false"
                                      large: true
                                      outline: true
                                      style:
                                        width: 25%
                                      text: Hell
                                  - component: oh-button
                                    config:
                                      action: command
                                      actionCommand: "100"
                                      actionItem: =props.item_color
                                      active: "=(items[props.item_color].state > 80) ? true : false"
                                      large: true
                                      outline: true
                                      style:
                                        width: 25%
                                      text: Gemütlich
                      - component: oh-slider-card
                        config:
                          color: white
                          item: =props.item_color
                          label: true
                          style:
                            --f7-range-bar-active-bg-color: linear-gradient(to bottom, rgba(246,158,81,0), rgba(246,158,81,0.8))
                            --f7-range-bar-bg-color: rgba(246, 158, 81, 0.2)
                            --f7-range-bar-border-radius: 10px
                            --f7-range-bar-size: 18px
                            --f7-range-knob-box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3)
                            --f7-range-knob-size: 20px
                            --f7-range-label-text-color: black
                            margin-bottom: 20px
                            margin-top: -10px
    - component: oh-grid-row
      config: {}
      slots:
        default:
          - component: oh-grid-col
            config: {}
            slots:
              default:
                - component: oh-slider-card
                  config:
                    color: white
                    item: =props.item_brightness
                    label: true
                    style:
                      --f7-range-bar-active-bg-color: linear-gradient(to bottom, rgba(246,158,81,0), rgba(246,158,81,0.8))
                      --f7-range-bar-bg-color: rgba(246, 158, 81, 0.2)
                      --f7-range-bar-border-radius: 10px
                      --f7-range-bar-size: 18px
                      --f7-range-knob-box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3)
                      --f7-range-knob-size: 20px
                      --f7-range-label-text-color: black
                      margin: 10px
                    title: Helligkeit

Your environment

runtimeInfo:
  version: 3.4.0
  buildString: Release Build
locale: de-AT
systemInfo:
  configFolder: /etc/openhab
  userdataFolder: /var/lib/openhab
  logFolder: /var/log/openhab
  javaVersion: 11.0.11
  javaVendor: Azul Systems, Inc.
  javaVendorVersion: Zulu11.48+21-CA
  osName: Linux
  osVersion: 5.10.17-v7+
  osArchitecture: arm
  availableProcessors: 4
  freeMemory: 140188272
  totalMemory: 317366272
  startLevel: 100
@hypetsch hypetsch added bug Something isn't working main ui Main UI labels Jan 14, 2023
@florian-h05 florian-h05 self-assigned this Feb 14, 2023
@egoist6
Copy link

egoist6 commented Apr 16, 2023

I have noticed that behavior, too, and can add the following information:

  • on Android devices the popup appears twice
  • on iOS devices, however, the popup automatically disappears
  • the problem does not happen when releasing the button BEFORE the popup completely appeared
  • the problem does not happen when releasing the button 2 seconds AFTER the popup completely appeared

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working main ui Main UI
Projects
None yet
Development

No branches or pull requests

3 participants