mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-29 05:00:43 +10:00
Fix mobile SelectMultipleFilter.
It didn't call onSubmit after latest Final Form update was introduced to PR949. (v2.9.0))
This commit is contained in:
parent
c30a6ab6e2
commit
38cb342999
2 changed files with 47 additions and 3 deletions
|
|
@ -42,7 +42,30 @@
|
|||
}
|
||||
}
|
||||
|
||||
.fieldGroup {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.fieldGroupPlain {
|
||||
margin: 0;
|
||||
padding-left: 20px;
|
||||
padding-bottom: 30px;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.list {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.item {
|
||||
padding: 2px 0;
|
||||
|
||||
/* Fix broken multi-column layout in Chrome */
|
||||
page-break-inside: avoid;
|
||||
|
||||
@media (--viewportMedium) {
|
||||
padding: 4px 0;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,11 +2,32 @@ import React, { Component } from 'react';
|
|||
import { array, arrayOf, func, number, string } from 'prop-types';
|
||||
import classNames from 'classnames';
|
||||
import { injectIntl, intlShape } from 'react-intl';
|
||||
import { FieldCheckboxGroup } from '../../components';
|
||||
import { FieldCheckbox } from '../../components';
|
||||
|
||||
import { FilterPopup, FilterPlain } from '../../components';
|
||||
import css from './SelectMultipleFilter.css';
|
||||
|
||||
// SelectMultipleFilter doesn't need array mutators since it doesn't require validation.
|
||||
// TODO: Live edit didn't work with FieldCheckboxGroup
|
||||
// There's a mutation problem: formstate.dirty is not reliable with it.
|
||||
const GroupOfFieldCheckboxes = props => {
|
||||
const { id, className, name, options } = props;
|
||||
return (
|
||||
<fieldset className={className}>
|
||||
<ul className={css.list}>
|
||||
{options.map((option, index) => {
|
||||
const fieldId = `${id}.${option.key}`;
|
||||
return (
|
||||
<li key={fieldId} className={css.item}>
|
||||
<FieldCheckbox id={fieldId} name={name} label={option.label} value={option.key} />
|
||||
</li>
|
||||
);
|
||||
})}
|
||||
</ul>
|
||||
</fieldset>
|
||||
);
|
||||
};
|
||||
|
||||
class SelectMultipleFilter extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
|
@ -101,7 +122,7 @@ class SelectMultipleFilter extends Component {
|
|||
urlParam={urlParam}
|
||||
{...rest}
|
||||
>
|
||||
<FieldCheckboxGroup
|
||||
<GroupOfFieldCheckboxes
|
||||
className={css.fieldGroup}
|
||||
name={name}
|
||||
id={`${id}-checkbox-group`}
|
||||
|
|
@ -122,7 +143,7 @@ class SelectMultipleFilter extends Component {
|
|||
urlParam={urlParam}
|
||||
{...rest}
|
||||
>
|
||||
<FieldCheckboxGroup
|
||||
<GroupOfFieldCheckboxes
|
||||
className={css.fieldGroupPlain}
|
||||
name={name}
|
||||
id={`${id}-checkbox-group`}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue