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

Right clicking on entity button in firefox can result in button getting smaller #2396

Closed
Matt-PMCT opened this issue Jan 2, 2019 · 14 comments

Comments

@Matt-PMCT
Copy link

Home Assistant release with the issue:
0.84.6

Last working Home Assistant release (if known):
N/A

Browser and Operating System:
Windows 10 Firefox 64.0 (64-bit)

Description of problem:
I have 1 vertical stack, with 3 horizontal stacks, with 3 entity-buttons each. In Firefox, if I right click on the entity buttons the icons and buttons change size and get smaller depending on the length of the label. Picture here

Javascript errors shown in the web inspector (if applicable):
N/A

Additional information:

        - cards:
          - cards:
              - entity: light.dining_room_overhead
                type: entity-button
                tap_action:
                  action: toggle
                hold_action:
                  action: more-info
              - entity: light.front_entry_overhead
                type: entity-button
                tap_action:
                  action: toggle
                hold_action:
                  action: more-info
              - entity: light.garage_lights
                type: entity-button
                tap_action:
                  action: toggle
                hold_action:
                  action: more-info
            type: horizontal-stack
          - cards:
              - entity: light.guest_bedroom_main_lights
                type: entity-button
                tap_action:
                  action: toggle
                hold_action:
                  action: more-info
              - entity: light.gym_main_lights
                type: entity-button
                tap_action:
                  action: toggle
                hold_action:
                  action: more-info
              - entity: light.kitchen_main_lights
                type: entity-button
                tap_action:
                  action: toggle
                hold_action:
                  action: more-info
            type: horizontal-stack
          - cards:
              - entity: light.master_bathroom_main_lights
                type: entity-button
                tap_action:
                  action: toggle
                hold_action:
                  action: more-info
              - entity: light.master_bedroom_main_lights
                type: entity-button
                tap_action:
                  action: toggle
                hold_action:
                  action: more-info
              - entity: light.office_main_lights
                type: entity-button
                tap_action:
                  action: toggle
                hold_action:
                  action: more-info
            type: horizontal-stack
        type: vertical-stack
@nicop4
Copy link
Contributor

nicop4 commented Jan 14, 2019

Hello
Same behaviour here. I use Firefox on MacOS Mojave.
The icon size also change if the state of the entity associated to the button changes in the background while the page is displayed.

views:
  - title: Main
    id: test
    cards:
      - type: vertical-stack
        cards: 
          - type: thermostat
            entity: climate.family_room
          - type: custom:button-card
            entity: sensor.family_room_thermostat_hvac_state
            icon: mdi:radiator-off
            size: 10%
            state:
              - value: 'heating'
                icon: mdi:radiator
                color: rgb(255, 129, 0)

I use Home Assistant release 0.85.1, but the problem was present before. I don't know since when though.
It works fine on Safari or Chrome.

I will try to investigate on my side.

@iantrich
Copy link
Member

@nicop4 we don't offer support for custom cards

@iantrich
Copy link
Member

@Lopton I agree that this is strange behavior but why are you right clicking on the buttons?

@nicop4
Copy link
Contributor

nicop4 commented Jan 14, 2019

@iantrich Well, personally I don't right click on purpose on the buttons :) but I noticed the behaviour that @Lopton described was the same as when the entity state changes in the background (and it's more annoying for me).
As the source cause could be related, I give another example if it can help.

Agreed for the custom card support I will ask on their repo.

@iantrich
Copy link
Member

@nicop4 unfortunately I think the dev for button-card has abandoned the project

@nicop4
Copy link
Contributor

nicop4 commented Jan 14, 2019

@iantrich I pushed a PR to him for an open issue a few days ago, a new release should be released soon so it seems still active :)

I could "fix" my issue by setting a size in pixel to my icon instead of a percentage (it was set to 40% by default). My icon is now fixed. It seems something was reapplying the percentage on the size at each refresh, I don't know why.
If it can help troubleshoot this issue...

@iantrich
Copy link
Member

@nicop4 nice

@Matt-PMCT
Copy link
Author

@iantrich in a project intended for the public users asking why they would do something as simple as right clicking seems off to me.

However the truth is that the buttons change size on their own even without right clicking, the right clicking was a sure fire way for me to demonstrate the problem, because it has 100% success. But even without the right click the result is the Home Assistant view with the enitty-buttons looks like a 4 year old made it.

Personally I gave up on the entity button and have moved to the custom kuuji/button-card by because of the multiple of problems with the built-in entity-button

@iantrich
Copy link
Member

@Lopton I was genuinely curious, not saying it is acceptable. Thanks for your constructive feedback

@tomlut
Copy link

tomlut commented Jan 28, 2019

It happens with left clicks too. See my duplicate #2614

@Bishma
Copy link

Bishma commented Feb 1, 2019

I think this may be getting worse over time. I opened HA in Firefox for the first time since December and noted that the issue was still present (left or right click for me). Back then the buttons would reset on refresh, now they do not.

@SaturnusDJ
Copy link

Similar behaviour here.

@dannyqwertz
Copy link

Same behaviour over here (with deprecated custom:button-card AND with 'new' lovelace entity-button-card)

I think it maybe has something to do with css-selector "keyboard-focus" (I think this class gets assigned to paper-button when focus is on this button)

Happens 100% when right clicking (if the right-click goes through) and when tabbing between elements.
Sometimes happens when only left-clicking, too (couldn't replicate any pattern yet, but again, 'keyboard-focus' related)

As soon as the element gets assigned to class 'keyboard-focus' it changes size / jumps / views the text in bold.

grafik
lovelace_entity-button_bug_2

@iantrich
Copy link
Member

I've been able to confirm this bug on 0.87.1, but it looks like the conversion to using mwc-button has resolved it in dev. 🎉 @balloob
fixed by #2744

Should be in the next beta #2747

@github-actions github-actions bot locked and limited conversation to collaborators Jul 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants