Commit 6010061e authored by John Kirkwood's avatar John Kirkwood

Fix MDC Submit button.

parent b469ec19
Pipeline #1573 passed with stage
in 37 seconds
......@@ -53,8 +53,7 @@ class PostForm(forms.ModelForm):
Flex([],
[
SubmitButton([cp("form", "form-chp")]),
],
{"display": "grid"}),
]),
])
]) # Cell
]) # Row
......
......@@ -59,8 +59,8 @@ def test_render(postform):
</select>
<label for="id_foreignkey" class="mdc-floating-label" chp-id="\d+">Foreignkey:</label>
<div class="mdc-line-ripple" chp-id="\d+"></div></div></div>
<div style="display: grid;" chp-id="\d+">
<div class="mdc-button" data-mdc-auto-init="None" chp-id="\d+"><button form="form-chp" type="submit" chp-id="\d+">Submit</button></div></div>
<div style="display: flex;" chp-id="\d+">
<button form="form-chp" class="mdc-button" type="submit" chp-id="\d+">Submit</button></div>
</form></div></div></div>
"""
regex = regex.replace("\n", "")
......
......@@ -224,13 +224,10 @@ def InputField(props=[], children=[], context={}):
def SubmitButton(props=[], children=[]):
"""Wrap a submit button in an MDC field."""
props.append(
cp("class", "mdc-button"))
ast = chp.SubmitButton(props, children)
props_div = [
cp("class", "mdc-button"),
cp("data-mdc-auto-init", None),
]
children_div = [ast]
return Div(props_div, children_div)
return ast
def Select(props=[], children=[]):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment