eeditiones / tei-publisher-components

Web components used by TEI Publisher and apps generated by it
https://cdn.tei-publisher.com/
GNU General Public License v3.0
18 stars 14 forks source link

[CSS] Delete display:flex from pb-autocomplete #44

Open plutonik-a opened 4 years ago

plutonik-a commented 4 years ago

pb-automplete simply consists of an input and a label. Despite that fact, the unnecessary rule display: flex; align-items: center; is set globally and causes layout problems when adding more inputs into a form, or in mixing with other flexed elements.

I guess, the initial reason for this rule was to insert elements like a select element into the component, so that the select and input are displayed inline. (-> Example "Combine with other form fields whose value is passed on" https://unpkg.com/@teipublisher/pb-components@1.2.0/dist/api.html#pb-autocomplete.1)

Screenshot 2020-09-14 at 20 13 09

Another side effect could be that the dropdown with the autosuggestions will be pinned next to the input instead of under it.

This rule should be set by either placing a customizable variable into the webcomponent, or just left blank.

tuurma commented 4 years ago

Indeed, the default behaviour of nested components (eg when combining pb-autocomplete with pb-select) should be aligned with the parent, like in the Combine with other form fields... example.

Would you care to create a PR for develop branch that assures this default behaviour is retained while not causing side-effects?

JoernT commented 4 years ago

layout should certainly as basic as possible and such specific settings should be avoided. Further i found that often it's a good idea to just use 'inherit' on the :host matcher in a component to overcome such issues.