This repository has been archived by the owner on Jan 13, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Support space-between in form field #5747
Labels
Comments
Proposed solution would be to add the following CSS: .mdc-form-field--space-between {
justify-content: space-between;
} |
@Misiu we'll need to prioritize resources for this, but it should be a relatively easy feature to add if you want to take a shot at a pull request. |
@asyncLiz something like this: https://jsfiddle.net/Misiu/quzgcsev/25/ ?? I never did PR to this repo, but I can try if the results are ok with you 🙂 |
copybara-service bot
pushed a commit
that referenced
this issue
Mar 31, 2020
This PR adds `mdc-form-field--space-between` class. fixes: #5747 This allows easily creating this layout: ![image](https://user-images.githubusercontent.com/1741838/77768710-23904a80-7043-11ea-9c44-8febdc8e0430.png) https://jsfiddle.net/Misiu/quzgcsev/25/ Sample code: ``` <div class="mdc-form-field mdc-form-field--space-between" id="form1"> <div class="mdc-switch" id="switch1"> <div class="mdc-switch__track"></div> <div class="mdc-switch__thumb-underlay"> <div class="mdc-switch__thumb"></div> <input type="checkbox" id="basic-switch1" class="mdc-switch__native-control" role="switch" aria-checked="false"> </div> </div> <label for="basic-switch1">off/on</label> </div> ``` I've added support for `mdc-form-field--align-end`, but I'm not sure how support for RTL languages should look. Also, this is my first PR in this repo, so sorry for any mistakes. PiperOrigin-RevId: 303416506
copybara-service bot
pushed a commit
that referenced
this issue
Apr 1, 2020
This PR adds `mdc-form-field--space-between` class. fixes: #5747 This allows easily creating this layout: ![image](https://user-images.githubusercontent.com/1741838/77768710-23904a80-7043-11ea-9c44-8febdc8e0430.png) https://jsfiddle.net/Misiu/quzgcsev/25/ Sample code: ``` <div class="mdc-form-field mdc-form-field--space-between" id="form1"> <div class="mdc-switch" id="switch1"> <div class="mdc-switch__track"></div> <div class="mdc-switch__thumb-underlay"> <div class="mdc-switch__thumb"></div> <input type="checkbox" id="basic-switch1" class="mdc-switch__native-control" role="switch" aria-checked="false"> </div> </div> <label for="basic-switch1">off/on</label> </div> ``` I've added support for `mdc-form-field--align-end`, but I'm not sure how support for RTL languages should look. Also, this is my first PR in this repo, so sorry for any mistakes. PiperOrigin-RevId: 303416506
aforemny
pushed a commit
to aforemny/material-components-web
that referenced
this issue
Mar 5, 2021
This PR adds `mdc-form-field--space-between` class. fixes: material-components#5747 This allows easily creating this layout: ![image](https://user-images.githubusercontent.com/1741838/77768710-23904a80-7043-11ea-9c44-8febdc8e0430.png) https://jsfiddle.net/Misiu/quzgcsev/25/ Sample code: ``` <div class="mdc-form-field mdc-form-field--space-between" id="form1"> <div class="mdc-switch" id="switch1"> <div class="mdc-switch__track"></div> <div class="mdc-switch__thumb-underlay"> <div class="mdc-switch__thumb"></div> <input type="checkbox" id="basic-switch1" class="mdc-switch__native-control" role="switch" aria-checked="false"> </div> </div> <label for="basic-switch1">off/on</label> </div> ``` I've added support for `mdc-form-field--align-end`, but I'm not sure how support for RTL languages should look. Also, this is my first PR in this repo, so sorry for any mistakes. PiperOrigin-RevId: 304204642
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Feature Request
I'm trying to create this type of UI:
![image](https://user-images.githubusercontent.com/1741838/77621202-484dca80-6f3c-11ea-972a-fd825336ced0.png)
![image](https://user-images.githubusercontent.com/1741838/77621303-7a5f2c80-6f3c-11ea-88df-da18e1a68371.png)
with web components, but unfortunately it isn't easy doable.
I was suggested to use
formfield
but this gives me this:The label is on the other side and there is no space between.
I got a suggestion from @asyncLiz (in material-components/material-web#999) to create this FR and ask to add
mdc-form-field--space-between
that would allow easy creating such UI.This type of UI is presented at official material.io site: https://material.io/components/selection-controls/#switches so I think there should be first-class support for it.
Proposed solution
Alternatives considered
Additional context
My main goal is to have support for this in
https://github.com/material-components/material-components-web-components
, but I think if this will be addressed here then the next step is adding support in web components.The text was updated successfully, but these errors were encountered: