custom_fields absolute position not working
See original GitHub issueDescribe the bug
Following the documentation on custom_fields
here (https://github.com/custom-cards/button-card#custom-fields) together with position:
I expect to be able to position a nested card on top of the main card. However, it is positioned adjacent to it.
Version of the card Version: 3.4.1
To Reproduce This is the configuration I used:
entity: lock.haustur
show_name: true
show_state: false
state:
- value: locked
entity_picture: /local/images/nuki/nuki_locked_alpha.png
- value: unlocked
entity_picture: /local/images/nuki/nuki_unlocked_alpha.png
show_entity_picture: true
tap_action:
action: call-service
service: lock.open
service_data:
entity_id: lock.haustur
size: 60%
styles:
card:
- '--mdc-ripple-color': black
- '--mdc-press-opacity': 0.5
grid:
- position: relative
custom_fields:
- position: absolute
- top: 50%
custom_fields:
State:
card:
type: markdown
content: '[[[ return entity.state ]]]'
style: |
ha-card {
box-shadow: none;
}
Screenshots This is the resulting card:
Expected behavior I would like to see the state locked written in the center of the circle
Desktop (please complete the following information):
- Browser: Edge
- Version 87.0.664.66
Smartphone (please complete the following information):
- Device: Samsung S20
- OS: Android 11
- Home Assistant App
Issue Analytics
- State:
- Created 3 years ago
- Comments:5
Top Results From Across the Web
Absolute position is not working - Stack Overflow
The solution is to apply position:relative to the parent div, which forces it to become a positioned element and the child's offsetParent ....
Read more >A Guide to Understanding & Using Divi's Absolute Position
The absolute position property is one of four main position types available within Divi and its new position options.
Read more >CSS-Overflow hidden not working for absolutely positioned ...
In order to have absolute positioned “wrapper img” work with the property of overflow: hidden, position the parent element “wrapper” to ...
Read more >CSS "absolute" on nested child container required to position it
Problem : I can't seem to position the inner container without assigning a class ... with Toolset for custom field types and complex...
Read more >Create a Smart Contact Form - Help Scout Support
Add Custom Fields to Beacon on Help Scout Plus. Did this answer your question? Thanks for the feedback There was a problem submitting ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks, adding
pointer-events: none
indeed does work. I just read in issue #410 that this behaviour is expected but the solution is as simple as it is elegant.For the benefit of anyone ever reading this, here is my full card code which I use to control a Nuki lock:
As the
lock
entity doesn’t know any toggle, I call a script depending onstate
:You can maybe try by adding
pointer-events: none
to the style of your custom_field named State. However, what you are having is the expected behavior. A child card will catch the events, thus the the child card action defined in its own config is executed.