Giter Club home page Giter Club logo

Comments (4)

mbrookes avatar mbrookes commented on July 19, 2024

Did you actually pick a time, or just click OK? If the latter, it's a MUI bug.

The same code for FormsyTime is here: https://github.com/mbrookes/formsy-mui-demo/blob/master/Form.jsx

Hand can be seen working at the site linked from the README in that Repo.

from formsy-material-ui.

lishine avatar lishine commented on July 19, 2024

I actually pick the time and then click ok
I am using the new Meteor beta
Same class as in Form.jsx

import React from 'react'
import * as rb from 'react-bootstrap'
import injectTapEventPlugin from 'react-tap-event-plugin';
import { FormsyCheckbox, FormsyDate, FormsyRadio, FormsyRadioGroup, FormsySelect, FormsyText, FormsyTime, FormsyToggle } from 'formsy-material-ui'
import RaisedButton from 'material-ui/lib/raised-button'
import MenuItem from 'material-ui/lib/menus/menu-item'
import TimePicker from 'material-ui/lib/time-picker'
import Paper from 'material-ui/lib/paper'
import Styles from 'material-ui/lib/styles'
injectTapEventPlugin();

export default React.createClass({

childContextTypes: {
    muiTheme: React.PropTypes.object
},

getChildContext(){
    return {
        muiTheme: Styles.ThemeManager.getMuiTheme(Styles.LightRawTheme)
    }
},

getInitialState() {
    return {
        canSumbit: false
    };
},

errorMessages: {
    wordsError: "Please only use letters",
    numericError: "Please provide a number",
    urlError: "Please provide a valid URL"
},

styles: {
    paperStyle: {
        width: 300,
        margin: 'auto',
        padding: 20
    },
    switchStyle: {
        marginBottom:16
    },
    submitStyle: {
        marginTop: 32
    }
},

enableButton() {
    this.setState({
        canSubmit: true
    });
},

disableButton() {
    this.setState({
        canSubmit: false
    });
},

submitForm(data) {
    alert(JSON.stringify(data, null, 4));
},

notifyFormError(data) {
    console.error('Form error:', data);
},

render() {
    let {paperStyle, switchStyle, submitStyle } = this.styles;
    let { wordsError, numericError, urlError } = this.errorMessages;

    return (
        <Paper style={paperStyle}>

            <Formsy.Form
                onValid={this.enableButton}
                onInvalid={this.disableButton}
                onValidSubmit={this.submitForm}
                onInvalidSubmit={this.notifyFormError}
            >

                <FormsyText
                    name="name"
                    validations="isWords"
                    validationError={wordsError}
                    required
                    hintText="What is your name?"
                    floatingLabelText="Name"
                />

                <FormsyText
                    name="age"
                    validations="isNumeric"
                    validationError={numericError}
                    hintText="Are you a wrinkly?"
                    floatingLabelText="Age (optional)"
                />

                <FormsyText
                    name="url"
                    validations="isUrl"
                    validationError={urlError}
                    required
                    defaultValue="http://"
                    hintText="http://www.example.com"
                    floatingLabelText="URL"
                />

                <FormsySelect
                    name="frequency"
                    required
                    floatingLabelText="How often do you?"
                    menuItems={this.selectFieldItems}
                >
                    <MenuItem value={'never'} primaryText="Never" />
                    <MenuItem value={'nightly'} primaryText="Every Night" />
                    <MenuItem value={'weeknights'} primaryText="Weeknights" />
                </FormsySelect>

                <FormsyDate
                    name="date"
                    required
                    floatingLabelText="Date"
                />

                <FormsyTime
                    name="time"
                    required
                    floatingLabelText="Time"
                />

                <FormsyCheckbox
                    name="agree"
                    label="Do you agree to disagree?"
                    style={switchStyle}
                />

                <FormsyToggle
                    name="toggle"
                    label="Toggle"
                    style={switchStyle}
                />

                <FormsyRadioGroup name="shipSpeed" defaultSelected="not_light">
                    <FormsyRadio
                        value="light"
                        label="prepare for light speed"
                        style={switchStyle}
                    />
                    <FormsyRadio
                        value="not_light"
                        label="light speed too slow"
                        style={switchStyle}
                    />
                    <FormsyRadio
                        value="ludicrous"
                        label="go to ludicrous speed"
                        style={switchStyle}
                        disabled={true}
                    />
                </FormsyRadioGroup>

                <RaisedButton
                    style={submitStyle}
                    type="submit"
                    label="Submit"
                    disabled={!this.state.canSubmit}
                />
            </Formsy.Form>
        </Paper>
    );
}

});

from formsy-material-ui.

mbrookes avatar mbrookes commented on July 19, 2024

Hi @lishine - I can't reproduce this with the current version. Is this still an issue?

from formsy-material-ui.

mbrookes avatar mbrookes commented on July 19, 2024

Closing due to no response.

from formsy-material-ui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.