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

oh-icon - style is not applied to the underlying tags in all cases #1183

Closed
crnjan opened this issue Oct 19, 2021 · 0 comments · Fixed by #1233
Closed

oh-icon - style is not applied to the underlying tags in all cases #1183

crnjan opened this issue Oct 19, 2021 · 0 comments · Fixed by #1233
Assignees
Labels
bug Something isn't working main ui Main UI

Comments

@crnjan
Copy link
Contributor

crnjan commented Oct 19, 2021

The problem

Playing with heating widget and trying to use iconify icons - so replacing f7-icon with a oh-icon - the icon(s) were not displayed.

It turns out the problem is related to the style property and how it's applied.

Expected behavior

One should be able to use custom style with oh-icon.

Steps to reproduce

component: f7-card
config:
  title: TEST
slots:
  default:
    - component: oh-icon
      config:
        height: 28px
        icon: iconify:mdi:fan-speed-3
        style:
          position: absolute
          top: 5px
          left: 55px

will render

Screenshot 2021-10-19 at 20 08 30

ignoring the content within style. As far as I can see from code style is only (fully) applied for oh icons, while not for others:

component: f7-card
config:
  title: TEST
slots:
  default:
    - component: oh-icon
      config:
        height: 28px
        icon: oh:light
        style:
          position: absolute
          top: 5px
          left: 55px

will render

Screenshot 2021-10-19 at 20 17 36

since style is applied to underlying img, while not for other two (f7-icon and iconify-icon).

Additional Info

Wrapping oh-icon in another block "fixes" the issue:

component: f7-card
config:
  title: TEST
slots:
  default:
  - component: f7-block
    config:
      style:
        position: absolute
        top: 5px
        left: 55px
    slots:
      default:
      - component: oh-icon
        config:
          height: 28px
          icon: iconify:mdi:fan-speed-3

renders:

Screenshot 2021-10-19 at 20 28 16

IMHO other sections of report are not needed therefore removed them, but please let me know if there is any more info needed from my side.

@crnjan crnjan added bug Something isn't working main ui Main UI labels Oct 19, 2021
@ghys ghys self-assigned this Dec 15, 2021
ghys added a commit to ghys/openhab-webui that referenced this issue Dec 15, 2021
ghys added a commit that referenced this issue Dec 16, 2021
ghys added a commit that referenced this issue Dec 18, 2021
Fixes #1242.
Checking that the oh-icon has a config set is enough to solve both #1242 and #1183.

Signed-off-by: Yannick Schaus <[email protected]>
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

Successfully merging a pull request may close this issue.

2 participants