Skip to content

fix(input): fixed attribute #233

Merged
merged 1 commit into from
Sep 13, 2017
Merged

fix(input): fixed attribute #233

merged 1 commit into from
Sep 13, 2017

Conversation

vladnkolesnikov
Copy link
Contributor

input noValidate --> formNoValidate

Мотивация и контекст

У инпута нет такого атрибута.

@vladnkolesnikov vladnkolesnikov changed the title fixed attribute fix(input): fixed attribute Sep 4, 2017

/**
* Атрибут формы, а не компонента
* @deprecated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Кажется, для этого есть deprecation type. @akitov?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

id: this.props.id,
name: this.props.name,
type: props.type,
formNoValidate: props.formNoValidate || props.noValidate,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Здесь должна быть проверка на undefined, если formNoValidate false, то применится noValidate.

let isMaskedInput = this.props.mask !== undefined;
let value = this.props.value !== undefined
? this.props.value
let props = this.props;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Очень много изменений из-за того, что убираем обращение через this. Если это необходимый рефакторинг, то лучше вынести его отдельным коммитом.

package.json Outdated
@@ -1,6 +1,6 @@
{
"name": "arui-feather",
"version": "9.5.0",
"version": "9.5.1",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Зачем?

@@ -183,6 +189,7 @@ class Input extends React.Component {
}

renderContent(cn, MaskedInput) {
let hasValidateAttr = this.props.formNoValidate !== undefined;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Я думаю можно опустить создание переменной - ты используешь результат всего один раз.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

код легче читается, нежели
this.props.formNoValidate !== undefined ? this.props.formNoValidate : this.props.noValidate

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Тогда выровняй нейминг с переменной ниже


/**
* Атрибут формы, а не компонента
* @deprecated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tx44 tx44 merged commit 33cffe3 into master Sep 13, 2017
@tx44 tx44 deleted the fix/formNoValidate-attr branch September 13, 2017 09:05
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants