Skip to content

BaseControl: disabled controls are always omitted - #90

Merged
dg merged 1 commit into
nette:masterfrom
martinknor:master
Mar 30, 2016
Merged

BaseControl: disabled controls are always omitted#90
dg merged 1 commit into
nette:masterfrom
martinknor:master

Conversation

@martinknor

Copy link
Copy Markdown
Contributor

No description provided.

@dg

dg commented Oct 9, 2015

Copy link
Copy Markdown
Member

Please change commit message to something like 'BaseControl: disabled controls are always omitted'

@chemix

chemix commented Mar 29, 2016

Copy link
Copy Markdown
Member

ping @martinknor can you please update commit message

@martinknor martinknor changed the title Fix omitted after setDisabled(false) BaseControl: disabled controls are always omitted Mar 29, 2016
@dg

dg commented Mar 30, 2016

Copy link
Copy Markdown
Member

Thanks

@dg
dg merged commit 211314c into nette:master Mar 30, 2016
@enumag

enumag commented Mar 30, 2016

Copy link
Copy Markdown
Contributor

@dg Are you aware that this is BC break? I actually used ->setDisabled(true)->setOmitted(false) once (don't remember where or why though).

@dg

dg commented Mar 30, 2016

Copy link
Copy Markdown
Member

Yes, it can be a BC break. In what case do you use it?

@enumag

enumag commented Mar 30, 2016

Copy link
Copy Markdown
Contributor

@dg It is an input that is disabled by default but sometimes enabled by javascript. I can easily refactor it to get around this of course. Just wanted to point out the BC break fact.

@pavelkouril

Copy link
Copy Markdown

What positive behavior will this change bring (and does it justify the BC break)?

Also, @enumag, how do you get around this BC break to keep the same functionality?

@matej21

matej21 commented Mar 30, 2016

Copy link
Copy Markdown
Contributor

You can find discussion here: https://gitter.im/nette/nette/cs?at=55c0a9ac7a6037e67c597569 (czech only)
tl;dr; before this, when you called ->setDisabled(TRUE)->setDisabled(FALSE) then a control was still omitted

matej21 added a commit to matej21/nette-forms that referenced this pull request Mar 30, 2016
@matej21

matej21 commented Mar 30, 2016

Copy link
Copy Markdown
Contributor

fixed in #116

@enumag

enumag commented Mar 30, 2016

Copy link
Copy Markdown
Contributor

@pavelkouril I'd probably just reverse the behavior - the field would be enabled by default and disabled by javascript in some cases. PR #116 should remove the BC break though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants