Material-ui: [TextField] 양식 μžλ™ 완성이 ν…μŠ€νŠΈ ν•„λ“œμ˜ 뢀동 λ ˆμ΄λΈ” ν…μŠ€νŠΈλ₯Ό μ—…λ°μ΄νŠΈν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.

에 λ§Œλ“  2015λ…„ 05μ›” 29일  Β·  75μ½”λ©˜νŠΈ  Β·  좜처: mui-org/material-ui

크둬을 μ‚¬μš©ν•˜μ—¬ ν…μŠ€νŠΈ ν•„λ“œλ₯Ό μžλ™ μ±„μš°κΈ°ν•˜λ©΄ ν”Œλ‘œνŒ… λ ˆμ΄λΈ” ν…μŠ€νŠΈκ°€ 움직이지 μ•Šκ³  μ „ν˜€ ν‘œμ‹œλ˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€ (0.8.0 κΈ°μ€€).

bug πŸ› TextField external dependency v0.x

κ°€μž₯ μœ μš©ν•œ λŒ“κΈ€

아직 μ—¬κΈ°μ—μžˆλŠ” μ‚¬λžŒμ΄ μžˆλ‹€λ©΄μ΄ νš¨κ³Όκ°€ 적용된 TextField 에 InputLabelProps={{ shrink: true }} 이 prop을 μ„€μ •ν–ˆμŠ΅λ‹ˆλ‹€. 우리 νŒ€μ„μœ„ν•œ 졜고의 μ†”λ£¨μ…˜μ΄μ—ˆμŠ΅λ‹ˆλ‹€.

λͺ¨λ“  75 λŒ“κΈ€

이것은 μ•„λ§ˆλ„ μ‹œμž‘ν•˜κΈ°μ— 쒋은 곳일 κ²ƒμž…λ‹ˆλ‹€ ...

@illogikal 당신은 gif의 κ²Œμ‹œ ν•  수 μžˆμŠ΅λ‹ˆκΉŒ?

μ—¬κΈ° μžˆμŠ΅λ‹ˆλ‹€ :

image

λ…Έλž€μƒ‰ κ°•μ‘° ν‘œμ‹œλŠ” ν•„λ“œκ°€ μžλ™μœΌλ‘œ μ±„μ›Œ μ‘ŒμŒμ„ λ‚˜νƒ€λƒ…λ‹ˆλ‹€. λ³΄μ‹œλ‹€μ‹œν”Ό μ•”ν˜ΈλŠ” μ±„μ›Œμ Έ μžˆμ§€λ§Œ λ ˆμ΄λΈ”μ€ μ—¬μ „νžˆ β€‹β€‹μ œμžλ¦¬μ— μžˆμŠ΅λ‹ˆλ‹€.

음, ν₯λ―Έ λ‘­κ΅°μš”. @mbrookes λͺ¨λ“  μž…λ ₯ μœ ν˜•μ„μœ„ν•œ 것인지 μ•„λ‹ˆλ©΄ λΉ„λ°€λ²ˆν˜Έ μž…λ ₯λ§Œμ„μœ„ν•œ 것인지 μ•Œκ³  μžˆμŠ΅λ‹ˆκΉŒ?

ν™•μ‹€ν•˜μ§€ μ•ŠμŒ-μ£Όμ†Œμ™€ λΉ„λ°€λ²ˆν˜Έμ˜ μˆœμ„œλ₯Ό λ°”κΎΈλ €κ³ ν–ˆμ§€λ§Œ μ•Œλ €μ§„ μ‚¬μš©μž / λΉ„λ°€λ²ˆν˜Έλ₯Ό μž…λ ₯ν•˜κ±°λ‚˜ μƒˆ λΉ„λ°€λ²ˆν˜Έλ₯Ό μ €μž₯ν•˜κΈ° μœ„ν•΄ μžλ™ 완성이 μ‹€ν–‰λ˜μ§€ μ•Šμ•˜μŠ΅λ‹ˆλ‹€. λ‹€λ₯Έ λΆ„μ•Όλ₯Ό ν…ŒμŠ€νŠΈν•˜λŠ” κ°€μž₯ 쒋은 방법을 μ°Ύμ•„μ•Όν•©λ‹ˆλ‹€.

μ’‹μ•„, κ°€κΉŒμš΄ μž₯λž˜μ— TextField ν•­λͺ© 쀑 일뢀λ₯Ό λ¦¬νŒ©ν† λ§ ν•  κ³„νšμž…λ‹ˆλ‹€. λ‚˜λ„ 쑰금 μ‹€ν—˜ ν•΄ 볼게. λ‹€λ₯Έ 점이 있으면 μ•Œλ €μ£Όμ„Έμš”.

μ•ˆλ…•ν•˜μ„Έμš”! μš°λ¦¬λŠ”μ΄ 문제λ₯Ό κ²ͺκ³  μžˆμŠ΅λ‹ˆλ‹€. 이에 λŒ€ν•œ 잠재적 인 μˆ˜μ •μ„ μ‹œλ„ν•˜κ³  μ‹€ν—˜ν•˜κΈ° μœ„ν•΄ λ‘œμ»¬μ—μ„œ ν•  μˆ˜μžˆλŠ” 일이 μžˆμŠ΅λ‹ˆκΉŒ? μ•„λ‹ˆλ©΄ λ¦¬νŒ©ν„°λ§μ„ κΈ°λ‹€λ €μ•Όν• κΉŒμš”?

μœ„μ— λ‚˜μ—΄λœ λΉ„λ°€λ²ˆν˜Έ ν•„λ“œμ— μ •ν™•ν•œ λ¬Έμ œκ°€ μžˆμŠ΅λ‹ˆλ‹€. κ·Έ 외에도 일반 TextField 와 μœ μ‚¬ν•œ λ¬Έμ œκ°€ μžˆμŠ΅λ‹ˆλ‹€. 값을 μž…λ ₯ν•˜λ©΄ μ‚¬λΌμ§€λŠ” 힌트 ν…μŠ€νŠΈ μ„ΈνŠΈκ°€ μžˆμŠ΅λ‹ˆλ‹€. κ·ΈλŸ¬λ‚˜ νŽ˜μ΄μ§€κ°€ λ Œλ”λ§ 될 λ•Œ 값을 μ„€μ •ν•˜λ©΄ (λ”₯ 링크) 힌트 ν…μŠ€νŠΈλŠ” μ—¬μ „νžˆ μ‹€μ œ κ°’ 뒀에 ν‘œμ‹œλ©λ‹ˆλ‹€. 이것은 λ™μΌν•œ 문제 일 κ°€λŠ₯성이 μžˆμŠ΅λ‹ˆκΉŒ μ•„λ‹ˆλ©΄ λ³„λ„μ˜ λ¬Έμ œμž…λ‹ˆκΉŒ?

image

이것은 λ™μΌν•œ 문제 일 κ°€λŠ₯성이 μžˆμŠ΅λ‹ˆκΉŒ μ•„λ‹ˆλ©΄ λ³„λ„μ˜ λ¬Έμ œμž…λ‹ˆκΉŒ?

λ‹€λ₯Έ 문제인 것 κ°™μŠ΅λ‹ˆλ‹€.

μ½”λ“œμ— μΆ”κ°€ ν•  수 onChange μ—…λ°μ΄νŠΈ ν•  수 state.isAutofilled

Chrome 버전 49.0.2623.87 (64 λΉ„νŠΈ) OS X El Capitan

image

ν‚€λ₯Ό λˆ„λ₯΄κ±°λ‚˜ 마우슀λ₯Ό ν΄λ¦­ν•˜λ©΄ μ˜¬λ°”λ₯΄κ²Œ ν”Œλ‘œνŒ…λ˜μ§€λ§Œ μ΄ˆκΈ°λ‘œλ“œκ°€ μ€‘λ‹¨λ©λ‹ˆλ‹€.

μ •ν™•νžˆ 같은 문제 :

s

μ–˜λ“€ μ•„?

같은 λ¬Έμ œκ°€ λ°œμƒν•©λ‹ˆλ‹€.

MUIμ—μ„œ μž‘λ™ν•˜λŠ” μžλ™ 완성을 λΉ„ν™œμ„±ν™”ν•˜λŠ” 방법이 μžˆμŠ΅λ‹ˆκΉŒ?

λΏ‘λΏ‘

λͺ‡ 개의 ν•„λ“œλ₯Ό λ§Œλ“€κ³  " display : none "을 μ‚¬μš©ν•˜μ—¬ μˆ¨κΈ°λ©΄λ©λ‹ˆλ‹€. 예:



그런 λ‹€μŒ μ‹€μ œ ν•„λ“œλ₯Ό μ•„λž˜μ— λ‘μ‹­μ‹œμ˜€.

http://stackoverflow.com/questions/15738259/disabling-chrome-autofill

onChange 이벀트λ₯Ό λ°œμƒμ‹œν‚€λŠ” μ†”λ£¨μ…˜μ΄ μžˆμŠ΅λ‹ˆκΉŒ?

@antoinerousseau 이것이 master에 병합 λ κΉŒμš”?

이것은 μœ μ‚¬ν•œ 문제 일 수 μžˆμŠ΅λ‹ˆλ‹€ (λ™μΌν•œ κ·Όλ³Έ 원인, λ‹€λ₯Έ 증상?)

μ–ΈκΈ‰ ν•œλŒ€λ‘œ μ• λ‹ˆλ©”μ΄μ…˜ λ¬Έμ œκ°€ ν‘œμ‹œλ˜μ§€ μ•Šμ§€λ§Œ TextField μ»¨ν…Œμ΄λ„ˆμ˜ λ†’μ΄λŠ” μž…λ ₯의 μœ„μͺ½ 여백을 κ³ λ €ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€. κ·Έ κ²°κ³Ό TextFieldκ°€ μ»¨ν…Œμ΄λ„ˆ μ•„λž˜λ‘œ 14px ν™•μž₯λ©λ‹ˆλ‹€. 맀우 κ°„λ‹¨ν•œ ν•΄κ²° λ°©λ²•μ΄μ§€λ§Œ μžλ™ μ™„μ„± κΈ°λŠ₯으둜 만 ν‘œμ‹œλ©λ‹ˆλ‹€.

screen shot 2016-06-22 at 9 58 04 am
screen shot 2016-06-22 at 9 58 16 am
screen shot 2016-06-22 at 9 58 27 am
screen shot 2016-06-22 at 9 58 34 am

곧 μˆ˜μ • 될 μ˜ˆμ •μž…λ‹ˆλ‹€.)

image

쒋은 @nathanmarks , κ°μ‚¬ν•©λ‹ˆλ‹€ !!

νŽ˜μ΄μ§€λ₯Ό ν΄λ¦­ν•˜μ§€ μ•Šκ³  크둬이 μžλ™ μ™„μ„± 될 λ•Œ ν”Œλ‘œνŒ… 라벨을 μ—…λ°μ΄νŠΈν•˜λŠ” 해킹을 μ°Ύμ•˜μŠ΅λ‹ˆκΉŒ?

이것은 μ—¬μ „νžˆ β€‹β€‹λ§€μš° κ³ ν†΅μŠ€λŸ¬μš΄ λ¬Έμ œμž…λ‹ˆλ‹€.

μž‘λ™ν•˜μ§€ μ•ŠλŠ” vanilla-autofill-event λ₯Ό μ‚¬μš©ν•΄ λ³΄μ•˜μŠ΅λ‹ˆλ‹€.

λ‚˜λŠ” redux-form (λ‹€λ₯Έ λ§Žμ€ μ‚¬λžŒλ“€κ³Ό λ§ˆμ°¬κ°€μ§€λ‘œ)을 μ‚¬μš©ν•˜κ³  있으며 μΆ”μ•…ν•œ ν•΄κ²° 방법을 μ°Ύμ•˜μŠ΅λ‹ˆλ‹€ (둜그인 μ–‘μ‹μ˜ 경우 λ‹€λ₯Έ μ–‘μ‹μ—λŠ” 관심이 μ—†μŠ΅λ‹ˆλ‹€).
ν¬λ‘¬μ—μ„œλ§Œ ν…ŒμŠ€νŠΈ ν–ˆμœΌλ―€λ‘œ 고렀쀑에 μ‚¬μš©ν•˜μ‹­μ‹œμ˜€.

μˆ¨κ²¨μ§„ μ‚¬μš©μž 이름 및 λΉ„λ°€λ²ˆν˜Έ ν•„λ“œλ₯Ό μΆ”κ°€ν–ˆμ„ λ•Œ 크둬은 전체 양식을 λ¬΄μ‹œν–ˆμŠ΅λ‹ˆλ‹€ (크둬이 μ‹ κ²½ 쓰지 μ•ŠλŠ” display : none으둜 μˆ¨κΈ°μ§€ μ•ŠλŠ” ν•œ).

κ·Έλž˜μ„œ 4 개의 (: disappointed :) μΆ”κ°€ ν•„λ“œλ₯Ό μ‚¬μš©ν–ˆμŠ΅λ‹ˆλ‹€. 2 크둬이 λ‚΄ 양식을 λ¬΄μ‹œν•˜λ„λ‘ (autocomplete = offκ°€ μž‘λ™ν•˜μ§€ μ•ŠμŒ) λ‹€λ₯Έ κ°€μ§œ 양식에 2 개 더 μΆ”κ°€ν–ˆμŠ΅λ‹ˆλ‹€. -양식 λ³€κ²½ 이벀트 :

class Login extends Component {
  // This was tested under chrome only. It's ugly, but it works. Code was modified a bit for simplicity so it might not work out of the box.

  componentDidMount() {
    // Fix chrome auto-fill
    setTimeout(() => {
      const { change, dispatch }= this.props;
      if (this.refs.usernameAutoFill.value && ! this.refs.username.value) {
        dispatch(change('username', this.refs.usernameAutoFill.value));
      }
      if (this.refs.passwordAutoFill.value && !this.refs.password.value) {
        dispatch(change('password', this.refs.passwordAutoFill.value));
      }
    }, 500);
  }

  render() {
    const styles = {
      autofill: {
        height: 0,
        width: '1px',
        position: 'absolute',
        left: 0,
        top: 0
      }
    };

    return (
      <div>
        <form style={styles.autofill}>
          <input type="text" ref="usernameAutoFill" name="usernameAutoFill" />
          <input type="password" ref="passwordAutoFill" name="passwordAutoFill" />
        </form>
        <form autocomplete="off">
          <div style={styles.autofill}><input type="text" name="fakeusername" /><input type="password" name="fakepassword" /></div>
          <Field name="username" component={() => <TextField ref="username" name="username" floatingLabelText="Username" />}/>
          <Field name="password" component={() => <TextField ref="password" name="password" type="password" floatingLabelText="Password" />}/>
          <RaisedButton primary={true} label="Login" type="submit"/>
        </form>
      </div>
    )
  }
}
export default {
  Form: reduxForm({
    form: 'Login'
  })(Login)
}

κ°„λ‹¨ν•˜κ²Œ μ½”λ“œλ₯Ό μˆ˜μ • ν–ˆμœΌλ―€λ‘œ μ°Έμ‘° 용으둜 만 μ‚¬μš©ν•˜μ‹­μ‹œμ˜€.

@ adamtal3 autoComplete="off"

@justinko 정말 μ€‘μš”ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€. autoComplete reactλ₯Ό μ‚¬μš©ν•˜λ©΄ autocomplete λ©λ‹ˆλ‹€.
js κ°’ ( {'off'} )이 μ•„λ‹Œ λ¬Έμžμ—΄ κ°’ ( "off" )을 μ‚¬μš©ν–ˆμŒμ„ μ•Œ 수 μžˆμŠ΅λ‹ˆλ‹€.

λ‚΄κ°€ λ™μ˜ν•˜λŠ” 것보닀 React ν‘œμ€€κ³Ό 일관성을 μ–ΈκΈ‰ν•˜κ³  μžˆμ§€λ§Œ 큰 λ¬Έμ œλŠ” μ•„λ‹ˆλΌκ³  μƒκ°ν•©λ‹ˆλ‹€.

이것이 λ‚΄ ν•΄κ²°μ±…μž…λ‹ˆλ‹€.

λ¨Όμ € μ»΄ν¬λ„ŒνŠΈκ°€ λ§ˆμš΄νŠΈλ˜μ—ˆμ„ λ•Œ μ‚¬μš©μž 이름이 μžλ™μœΌλ‘œ μ±„μ›Œ μ‘ŒλŠ”μ§€ ν™•μΈν–ˆμŠ΅λ‹ˆλ‹€.
κ·Έλ ‡λ‹€λ©΄ μ•”ν˜Έ ν•„λ“œμ˜ μƒνƒœλ₯Ό μ—…λ°μ΄νŠΈν•©λ‹ˆλ‹€.
hasValue κ°€ true둜 λ°”λ€Œλ©΄ ν”Œλ‘œνŒ… λ ˆμ΄λΈ”μ΄ μ—…λ°μ΄νŠΈλ©λ‹ˆλ‹€.

componentDidMount() {
    setTimeout(() => {
        if(this.refs.username.getValue()) {
            this.refs.password.setState({...this.refs.password.state, hasValue: true})
        }
    }, 100)
}

도움이 λ˜μ—ˆκΈ°λ₯Ό λ°”λžλ‹ˆλ‹€. :)

λΈŒλΌμš°μ €μ—μ„œ μžλ™μœΌλ‘œ μ±„μ›Œμ§ˆ λ•Œ ν”Œλ‘œνŒ… λ ˆμ΄λΈ”μ„ μ—…λ°μ΄νŠΈν•˜λŠ” 방법을 μ°Ύμ•˜μŠ΅λ‹ˆλ‹€.
`

setTimeout (function () {
var autofilled = document.querySelectorAll ( 'input # password : -webkit-autofill');
if (μžλ™ μ™„μ„±) {
$ ( "input [type = password]"). parent (). addClass ( "is-dirty");
}
}, 500);
`
λ§ˆμ§€λ§‰μ— μ€€λΉ„λœ λ¬Έμ„œ μ•ˆμ— μžˆμ–΄μ•Όν•©λ‹ˆλ‹€.
"is-dirty"ν΄λž˜μŠ€λŠ” ν”Œλ‘œνŒ… λ ˆμ΄λΈ”μ„ νŠΈλ¦¬κ±°ν•˜λŠ” ν΄λž˜μŠ€μž…λ‹ˆλ‹€.

react-ui와 ν•¨κ»˜ redux-form을 μ‚¬μš©ν•˜κ³  μžˆμŠ΅λ‹ˆλ‹€. λ‚˜λ₯Όμœ„ν•œ 해결책은 ν•„μš”ν•œ μž…λ ₯ λ°”λ‘œ 뒀에 κ°€μ§œ μž…λ ₯을 λ°°μΉ˜ν•˜λŠ” κ²ƒμž…λ‹ˆλ‹€.

  <TextField
     {...password}
     type="password"
     placeholder={formatMessage(messages.loginPasswordPlaceholder)}
     disabled={submitting}
   />
   <Icon name="password" className={theme.icon}/>
   <input className={theme.hiddenInput} type="password" />

React 16에 μ˜ν•΄ μˆ˜μ •λ˜μ–΄μ•Όν•©λ‹ˆλ‹€ : https://github.com/facebook/react/issues/7211#issuecomment -266774957

0.17.1μ—μ„œ 0.18.1둜 μ—…λ°μ΄νŠΈν–ˆμ„ λ•Œ λ™μΌν•œ λ¬Έμ œκ°€ λ°œμƒν–ˆμŠ΅λ‹ˆλ‹€.

λ‚˜λ₯Ό μœ„ν•΄ μΌν•œ μˆ˜μ • :

class FixedTextField extends Component {
    constructor() { 
       super()
       this.state = { value: '' } }
    }
    textfield = null

    componentDidMount() {
        requestAnimationFrame(() => {
            this.setState({ value: this.textfield.getInputNode().value })
        })
    }
    render() {
       return <TextField {...this.props} value={this.state.value} />
    }
}

μˆ˜μ • μ‚¬ν•­μ˜ λ°± ν¬νŠΈκ°€ React 15.6.0 μ—μ„œ 방금 λ¦΄λ¦¬μŠ€λ˜μ—ˆμŠ΅λ‹ˆλ‹€. 이 문제λ₯Ό ν•΄κ²°ν•  수 μžˆλŠ”μ§€ ν…ŒμŠ€νŠΈ ν•  μˆ˜μžˆλŠ” μ‚¬λžŒμ΄ μžˆμŠ΅λ‹ˆκΉŒ?

[μ°Έκ³  : μœ„μ˜ "λ‚˜λ„"κ²Œμ‹œλ¬Όμ€ μ‚­μ œλ©λ‹ˆλ‹€. 토둠을 μ‹œμž‘ν•˜μ§€ 말고 νˆ¬ν‘œ λ²„νŠΌμ„ μ‚¬μš©ν•˜μ„Έμš”.].

@mbrookes λ‚΄κ°€ ν…ŒμŠ€νŠΈ

@Stupidism μ„ΈλΆ€ 사항?

2 λ…„ 전에 κ²Œμ‹œ ν•œ 것과 κ°™μŠ΅λ‹ˆλ‹€. https://github.com/callemall/material-ui/issues/718#issuecomment -167445748

@Stupidism Material-UI의 버전, React의 버전, λΈŒλΌμš°μ € / 버전은?

  "name": "material-ui",
  "version": "0.18.3",
  "name": "react",
  "version": "15.6.0",



md5-b91bd30d63e87f3b504e2619fb81ef97



Google Chrome   59.0.3071.86 (Official Build) (64-bit)
OS  Linux
JavaScript  V8 5.9.211.31

image

: man_shrugging :이 경우 @ whtang906 의 ν•΄κ²° 방법 이 ν˜„μž¬ μ΅œμ„ μ˜ 선택 인 것 κ°™μŠ΅λ‹ˆλ‹€.

redux-form의 경우

  constructor(props) {
    super(props);

    // This binding is necessary to make `this` work in the callback
    this.refUsername = this.refUsername.bind(this);
    this.refPassword = this.refPassword.bind(this);
  }

  componentDidMount() {
    setTimeout(() => {
      if(this.usernameRef.getValue()) {
        this.passwordRef.setState({...this.passwordRef.state, hasValue: true});
      }
    }, 100)
  }

  refUsername(component) {
    this.usernameRef = component.getRenderedComponent().refs.component;
  }
  refPassword(component) {
    this.passwordRef = component.getRenderedComponent().refs.component;
  }


            <Field
              name="username"
              withRef
              ref={this.refUsername}
              component={TextField}
            />

            <Field
              name="password"
              type="password"
              withRef
              ref={this.refPassword}
              component={TextField}
            />

λ‚΄ 앱이 쑰금 λŠλ €μ„œ λ³΄ν—˜μ„ μΆ”κ°€ν–ˆμŠ΅λ‹ˆλ‹€

  componentDidMount() {
    let times = 0;
    const interval = setInterval(() => {
      times += 1;
      if(this.usernameRef.getValue()) {
        this.passwordRef.setState({...this.passwordRef.state, hasValue: true});
        clearInterval(interval);
      } else if (times >= 10) {
        clearInterval(interval);
      }
    }, 100)
  }

Chrome μžλ™ μ™„μ„± λΉ„λ°€λ²ˆν˜Έ ν•„λ“œμ—μ„œ 값을 κ°€μ Έμ˜¬ 수 μ—†μŠ΅λ‹ˆλ‹€.
https://stackoverflow.com/questions/35049555/chrome-autofill-autocomplete-no-value-for-password

λ‚΄κ°€ v1-beta 브랜치λ₯Ό 가지고 λ…ΈλŠ” ν•œ λ¬Έμ œλŠ” κ·Έ κ³Όμ •μ—μ„œ μˆ˜μ •λ˜μ—ˆμŠ΅λ‹ˆλ‹€. 재 μž‘μ„± λ˜λŠ” λ°˜μ‘μ˜ μ—…κ·Έλ ˆμ΄λ“œ 일 수 μžˆμŠ΅λ‹ˆλ‹€. μš°λ¦¬κ°€ 그것에 λŒ€ν•΄ 더듀을 λ•ŒκΉŒμ§€ λ‹«μŠ΅λ‹ˆλ‹€. ν† λ‘  ν•΄ μ£Όμ…”μ„œ κ°μ‚¬ν•©λ‹ˆλ‹€!

image
였λ₯˜κ°€ μ—¬μ „νžˆ μ‘΄μž¬ν•©λ‹ˆλ‹€ ...
[email protected]
[email protected]
크둬 60.0.3112.90

@artalar componentDidMount μ†”λ£¨μ…˜μ„ μ‹œλ„ν•΄λ³΄μ„Έμš” O (∩_∩) O

@Stupidism μ†”λ£¨μ…˜μ— κ°μ‚¬λ“œλ¦½λ‹ˆλ‹€! λ‚˜λŠ” μœ„μ˜ λͺ¨λ“  것을 μ‹œλ„ν–ˆμ§€λ§Œ κ·Έλ“€ 쀑 아무것도 μž‘λ™ν•˜μ§€ μ•Šμ•˜μŠ΅λ‹ˆλ‹€. μ•„λ§ˆ λŒ€λΆ€λΆ„ 1 ~ 2 μ‚΄μ΄λ‹ˆκΉŒ ...
Btw,이 λ²„κ·ΈλŠ” Chromeμ—μ„œλ§Œ λ°œμƒν•˜λ©° FirefoxλŠ” μ™„λ²½ν•©λ‹ˆλ‹€. :)

@ Ivan-Parushev ref의 μ‚¬μš©λ²•μ΄ λ³€κ²½ λ˜μ—ˆκΈ° λ•Œλ¬Έμ΄λΌκ³  μƒκ°ν•©λ‹ˆλ‹€. λ¬Έμ œκ°€ ν•΄κ²° λ˜μ—ˆμŠ΅λ‹ˆκΉŒ?

μ—¬κΈ°μ„œ ν•΄κ²°λ˜μ§€ μ•Šμ•˜μœΌλ©°, componentDidMount에 μ‘΄μž¬ν•˜λŠ” 경우 localStorageμ—μ„œ 값을 μ±„μš°κ³  λͺ¨λ“  μ΅œμ‹  λ²„μ „μ—μ„œ λ™μΌν•œ 였λ₯˜κ°€ λ°œμƒν•©λ‹ˆλ‹€.

μ—¬μ „νžˆ μˆ˜μ •μ„ 기닀리고 μžˆμŠ΅λ‹ˆλ‹€ ...

μŠ€λ ˆλ“œλ₯Ό 잠그고 μžˆμŠ΅λ‹ˆλ‹€. 이 λ¬Έμ œλŠ” 2 λ…„ μ „μž…λ‹ˆλ‹€. 이제 v1-beta λΈŒλžœμΉ˜μ— μ΄ˆμ μ„ λ§žμΆ”κ³  μžˆμŠ΅λ‹ˆλ‹€. 볡제 μ˜ˆμ‹œκ°€μžˆλŠ” μ‚¬λžŒμ΄ μžˆλ‹€λ©΄ v1-beta 브랜치의 μƒˆ 호λ₯Ό μ—΄μ–΄μ£Όμ„Έμš”.

이제 3 λ…„μ΄λ˜μ—ˆμŠ΅λ‹ˆλ‹€. 이 λ¬Έμ œλŠ” μ΅œμ‹  λ°˜μ‘ 및 머티리얼 UI 버전에도 μ—¬μ „νžˆ μ‘΄μž¬ν•©λ‹ˆλ‹€.

@tschaub HahaλŠ”

@tsmirnov 당신이

이 버그에 λŒ€ν•œ CSS μ†”λ£¨μ…˜μ΄ μžˆμŠ΅λ‹ˆλ‹€.

// Selects label that comes right after the autofilled input
input:-webkit-autofill + label {
    // Insert your active label styles
}

μ—¬κΈ° μžˆμŠ΅λ‹ˆλ‹€ :

image

λ…Έλž€μƒ‰ κ°•μ‘° ν‘œμ‹œλŠ” ν•„λ“œκ°€ μžλ™μœΌλ‘œ μ±„μ›Œ μ‘ŒμŒμ„ λ‚˜νƒ€λƒ…λ‹ˆλ‹€. λ³΄μ‹œλ‹€μ‹œν”Ό μ•”ν˜ΈλŠ” μ±„μ›Œμ Έ μžˆμ§€λ§Œ λ ˆμ΄λΈ”μ€ μ—¬μ „νžˆ β€‹β€‹μ œμžλ¦¬μ— μžˆμŠ΅λ‹ˆλ‹€.

λ‚˜λŠ” 같은 λ¬Έμ œμ— μ§λ©΄ν•˜κ³  μžˆμŠ΅λ‹ˆλ‹€.

이 버그에 λŒ€ν•œ CSS μ†”λ£¨μ…˜μ΄ μžˆμŠ΅λ‹ˆλ‹€.

// Selects label that comes right after the autofilled input
input:-webkit-autofill + label {
    // Insert your active label styles
}

이것이 무엇을 μ˜λ―Έν•˜λŠ”μ§€ μ„€λͺ…ν•΄ μ£Όμ‹œκ² μŠ΅λ‹ˆκΉŒ?

이 버그에 λŒ€ν•œ CSS μ†”λ£¨μ…˜μ΄ μžˆμŠ΅λ‹ˆλ‹€.

// Selects label that comes right after the autofilled input
input:-webkit-autofill + label {
    // Insert your active label styles
}

이것이 무엇을 μ˜λ―Έν•˜λŠ”μ§€ μ„€λͺ…ν•΄ μ£Όμ‹œκ² μŠ΅λ‹ˆκΉŒ?

: -webkit-autofill은 λΈŒλΌμš°μ €λ³„λ‘œ μžλ™ μ™„μ„± 된 ν•„λ“œλ₯Ό μ„ νƒν•©λ‹ˆλ‹€. μž…λ ₯ λ°”λ‘œ μ˜†μ— 라벨을 놓고 : -webkit-autofill μ„ νƒκΈ°λ‘œ μ„ νƒν•˜μ„Έμš”. 도움이 더 ν•„μš”ν•˜λ©΄ ν˜„μž¬ HTML ꡬ쑰λ₯Ό κ³΅μœ ν•˜μ„Έμš”.

이 버그에 λŒ€ν•œ CSS μ†”λ£¨μ…˜μ΄ μžˆμŠ΅λ‹ˆλ‹€.

// Selects label that comes right after the autofilled input
input:-webkit-autofill + label {
    // Insert your active label styles
}

이것이 무엇을 μ˜λ―Έν•˜λŠ”μ§€ μ„€λͺ…ν•΄ μ£Όμ‹œκ² μŠ΅λ‹ˆκΉŒ?

: -webkit-autofill은 λΈŒλΌμš°μ €λ³„λ‘œ μžλ™ μ™„μ„± 된 ν•„λ“œλ₯Ό μ„ νƒν•©λ‹ˆλ‹€. μž…λ ₯ λ°”λ‘œ μ˜†μ— 라벨을 놓고 : -webkit-autofill μ„ νƒκΈ°λ‘œ μ„ νƒν•˜μ„Έμš”. 도움이 더 ν•„μš”ν•˜λ©΄ ν˜„μž¬ HTML ꡬ쑰λ₯Ό κ³΅μœ ν•˜μ„Έμš”.

ν™•μ‹€ν•œ! μ—¬κΈ° λ‚΄ HTML이 μžˆμŠ΅λ‹ˆλ‹€. 감사
https://pastebin.com/yjJCip3r

이 버그에 λŒ€ν•œ CSS μ†”λ£¨μ…˜μ΄ μžˆμŠ΅λ‹ˆλ‹€.

// Selects label that comes right after the autofilled input
input:-webkit-autofill + label {
    // Insert your active label styles
}

이것이 무엇을 μ˜λ―Έν•˜λŠ”μ§€ μ„€λͺ…ν•΄ μ£Όμ‹œκ² μŠ΅λ‹ˆκΉŒ?

: -webkit-autofill은 λΈŒλΌμš°μ €λ³„λ‘œ μžλ™ μ™„μ„± 된 ν•„λ“œλ₯Ό μ„ νƒν•©λ‹ˆλ‹€. μž…λ ₯ λ°”λ‘œ μ˜†μ— 라벨을 놓고 : -webkit-autofill μ„ νƒκΈ°λ‘œ μ„ νƒν•˜μ„Έμš”. 도움이 더 ν•„μš”ν•˜λ©΄ ν˜„μž¬ HTML ꡬ쑰λ₯Ό κ³΅μœ ν•˜μ„Έμš”.

ν™•μ‹€ν•œ! μ—¬κΈ° λ‚΄ HTML이 μžˆμŠ΅λ‹ˆλ‹€. 감사
https://pastebin.com/yjJCip3r

라벨은 μž…λ ₯ λ°”λ‘œ 뒀에 λ‚˜μ˜€λ―€λ‘œ html둜 아무것도 ν•  ν•„μš”κ°€ μ—†μŠ΅λ‹ˆλ‹€.
μžλ™ μ™„μ„± 된 μž…λ ₯ λ°”λ‘œ μ˜†μ—μžˆλŠ” λ ˆμ΄λΈ”μ„ μ„ νƒν•˜κ³  μ•„λž˜μ™€ 같이 ν™œμ„± λ ˆμ΄λΈ” μŠ€νƒ€μΌμ„ μ„€μ •ν•˜μ‹­μ‹œμ˜€.

.mdl-textfield__input:-webkit-autofill + .mdl-textfield__label {
    // Active label styles here
    top: -20px; // Just an example
    transform: scale(0.75); // Just an example
}

μ–΄, @ kishan3 길을 μžƒμ€ 것 κ°™μ•„μš”. MDL은 이μͺ½μž…λ‹ˆλ‹€-> https://github.com/google/material-design-lite/issues/4827 πŸ˜†

(MDL이 μ§μ΄λΌλŠ” 사싀을 κ°μ•ˆν•  λ•Œ, μ•„λ§ˆλ„ 당신은 κ²°κ΅­ μ˜¬λ°”λ₯Έ μž₯μ†Œμ— 왔을 κ²ƒμž…λ‹ˆλ‹€!)

μ•„ μ  μž₯! 이름과 ν˜Όλ™ν•©λ‹ˆλ‹€. : μ›ƒμŒ : @mbrookes ν•œ 가지 질문 : CDN λ§ν¬κ°€μžˆλŠ”

@ kishan3 당신이 ν•  μˆ˜μžˆλŠ” , 그것은 λ¬Έμ„œμ—μ„œ λ§ν•˜λŠ” κ²ƒμ²˜λŸΌ, ν΄λΌμ΄μ–ΈνŠΈκ°€μ΄ μˆ˜λ‹¨μ„ κ΅¬μΆ•ν•˜λŠ” 반면,이 μΊμ‹œ 된 적어도 처음 ν•  λ•ŒκΉŒμ§€, 전체 라이브러리λ₯Ό λ‹€μš΄λ‘œλ“œ ν•  수 μžˆμ§€λ§Œ 둜컬 당신이 ꡬ성 μš”μ†Œκ°€ ν¬ν•¨λ˜λŠ” μ΅œμ ν™” ν•  수 μžˆμŒμ„ μ˜λ―Έν•©λ‹ˆλ‹€.

해결책은 λ¬΄μ—‡μž…λ‹ˆκΉŒ?

이 λ¬Έμ œλŠ” v0.x와 κ΄€λ ¨λ©λ‹ˆλ‹€.

@oliviertassinari 이 stil은 v3.4.0에 μ‘΄μž¬ν•©λ‹ˆλ‹€.

제 κ²½μš°μ—λŠ” λ“œλ‘­ λ‹€μš΄μ„ μ‚¬μš©ν•˜κ³  μžˆμŠ΅λ‹ˆλ‹€. μ‚¬μš©μžκ°€ λ“œλ‘­ λ‹€μš΄μ—μ„œ 무언가λ₯Ό μ„ νƒν•œ λ‹€μŒ 값을 μƒνƒœλ‘œ μ„€μ •ν•˜λ©΄ 값에 μ—°κ²°λœ TextFieldκ°€ λ ˆμ΄λΈ”μ„ λΆ€λ™ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.

νŽΈμ§‘ : λ³΄μ΄λŠ” κ²ƒμ²˜λŸΌ null 둜 TextField 값을 μ΄ˆκΈ°ν™”ν•˜λ©΄ μƒˆ 값이 전달 될 λ•Œ 뢀동 μ†Œμˆ˜μ μ΄ μ΄λ™ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€. null λŒ€μ‹  빈 λ¬Έμžμ—΄λ‘œ state의 값을 μ΄ˆκΈ°ν™”ν•˜μ—¬ μˆ˜μ •λ˜μ—ˆμŠ΅λ‹ˆλ‹€.

아직 μ—¬κΈ°μ—μžˆλŠ” μ‚¬λžŒμ΄ μžˆλ‹€λ©΄μ΄ νš¨κ³Όκ°€ 적용된 TextField 에 InputLabelProps={{ shrink: true }} 이 prop을 μ„€μ •ν–ˆμŠ΅λ‹ˆλ‹€. 우리 νŒ€μ„μœ„ν•œ 졜고의 μ†”λ£¨μ…˜μ΄μ—ˆμŠ΅λ‹ˆλ‹€.

@ tom-con κ°μ‚¬ν•©λ‹ˆλ‹€, 그것은 λ‚˜λ₯Ό μœ„ν•΄ μ™„λ²½ν•˜κ²Œ μž‘λ™ν–ˆμŠ΅λ‹ˆλ‹€.

screen shot 2019-01-24 at 10 47 44 pm
이 λ¬Έμ œλŠ” 2019 년에도 μ—¬μ „νžˆ μ‘΄μž¬ν•©λ‹ˆλ‹€ ...

아직 μ—¬κΈ°μ—μžˆλŠ” μ‚¬λžŒμ΄ μžˆλ‹€λ©΄μ΄ νš¨κ³Όκ°€ 적용된 TextField 에 InputLabelProps={{ shrink: true }} 이 prop을 μ„€μ •ν–ˆμŠ΅λ‹ˆλ‹€. 우리 νŒ€μ„μœ„ν•œ 졜고의 μ†”λ£¨μ…˜μ΄μ—ˆμŠ΅λ‹ˆλ‹€.
λ‚˜λŠ” 정말 ν˜Όλž€ μŠ€λŸ¬μ› κ³  당신은 문제λ₯Ό ν•΄κ²°ν–ˆμŠ΅λ‹ˆλ‹€! 졜고의 ꢌμž₯ μ†”λ£¨μ…˜!

v0.x 문제 (2015)μž…λ‹ˆλ‹€. # 14427을 μ°Έμ‘°ν•˜μ„Έμš”.

이 버그에 λŒ€ν•œ CSS μ†”λ£¨μ…˜μ΄ μžˆμŠ΅λ‹ˆλ‹€.

// Selects label that comes right after the autofilled input
input:-webkit-autofill + label {
    // Insert your active label styles
}

@ozturkcangokkaya μ•ˆλ…•ν•˜μ„Έμš”μ΄ CSS μ†”λ£¨μ…˜μ€ Chromeμ—μ„œ 잘 μž‘λ™ν•©λ‹ˆλ‹€. ν•˜μ§€λ§Œ firefoxμ—μ„œ λ‚΄ 양식을 확인할 λ•Œ 뢀동 λ ˆμ΄λΈ”μ΄ μž‘λ™ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€. μ™œ webkit-autofill이 firefox에 영ν–₯을 λ―ΈμΉ˜λŠ”μ§€ μ•„μ‹­λ‹ˆκΉŒ?

v4에 λŒ€ν•΄μ„œλŠ” # 14427을 μ°Έμ‘°ν•˜μ‹­μ‹œμ˜€.

κ°€μž₯ 쒋은 해결책은 Materialise μ‚¬μš©μ„ μ€‘μ§€ν•˜κ³  Bootstrap λ˜λŠ” λ‹€λ₯Έ 라이브러리λ₯Ό μ‚¬μš©ν•˜λŠ” κ²ƒμž…λ‹ˆλ‹€. ν•΄κ²° 방법을 μ°Ύμ•„μ•Όν•˜λ©° Google은 문제λ₯Ό ν•΄κ²°ν•˜λŠ” 데 κ΄€μ‹¬μ΄μ—†λŠ” 것 κ°™μŠ΅λ‹ˆλ‹€.

아직 μ—¬κΈ°μ—μžˆλŠ” μ‚¬λžŒμ΄ μžˆλ‹€λ©΄μ΄ νš¨κ³Όκ°€ 적용된 TextField 에 InputLabelProps={{ shrink: true }} 이 prop을 μ„€μ •ν–ˆμŠ΅λ‹ˆλ‹€. 우리 νŒ€μ„μœ„ν•œ 졜고의 μ†”λ£¨μ…˜μ΄μ—ˆμŠ΅λ‹ˆλ‹€.

κ°μ‚¬ν•©λ‹ˆλ‹€. InputLabelProps={{ shrink: form.password }} λ₯Ό μ‚¬μš©ν•˜κ³  있으며 μ™„λ²½ν•˜κ²Œ μž‘λ™ν•©λ‹ˆλ‹€.

<TextField
                id="loginPassword"
                label="Login Password"
                type="text"
                fullWidth
                value={form.password}
                onChange={(e) => setAttribute('form.password', e.target.value)}
                InputLabelProps={{ shrink: form.password }}
              />

λ‚΄ ν”„λ‘œμ νŠΈμ— lodash.mergeλ₯Ό μ„€μΉ˜ν•˜λŠ” 문제λ₯Ό ν•΄κ²° ν•œ ν›„ 쀑첩 된 개체λ₯Ό μ‚¬μš©ν•  λ•Œ reduxκ°€ λ™μΌν•΄μ•Όν•œλ‹€κ³  μƒκ°ν–ˆκΈ° λ•Œλ¬Έμ— ν…μŠ€νŠΈ ν•„λ“œ ꡬ성 μš”μ†Œλ₯Ό 잘λͺ» μ±„μš°κ³  μžˆμŒμ„ κΉ¨λ‹¬μ•˜μŠ΅λ‹ˆλ‹€.

λ³΄μ‹œλ‹€μ‹œν”Ό 두 개의 쀑첩 된 개체λ₯Ό ν˜Όν•© ν•  λ•Œ μ˜¬λ°”λ₯΄κ²Œ μ±„μ›Œμ§€μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.

image

λ‚˜λŠ” 라이브러리λ₯Ό μ‚¬μš©ν•˜μ—¬ 이것을 ν•΄κ²°ν–ˆκ³  κ·Έλ ‡κ²Œλ˜μ—ˆμŠ΅λ‹ˆλ‹€.
image

μ΅œμ‹  λ²„μ „μ˜ Material-UI (v4.9.0)λŠ” 기본적으둜이λ₯Ό μ§€μ›ν•©λ‹ˆλ‹€.

이 νŽ˜μ΄μ§€κ°€ 도움이 λ˜μ—ˆλ‚˜μš”?
0 / 5 - 0 λ“±κΈ‰

κ΄€λ ¨ 문제

anthony-dandrea picture anthony-dandrea  Β·  3μ½”λ©˜νŠΈ

ryanflorence picture ryanflorence  Β·  3μ½”λ©˜νŠΈ

ericraffin picture ericraffin  Β·  3μ½”λ©˜νŠΈ

rbozan picture rbozan  Β·  3μ½”λ©˜νŠΈ

FranBran picture FranBran  Β·  3μ½”λ©˜νŠΈ