Skip to content
This repository was archived by the owner on Mar 16, 2025. It is now read-only.

fixes issue when setting properties from $field don't set #19

Merged
merged 2 commits into from
Apr 11, 2016

Conversation

iBotPeaches
Copy link

When using the Dropdown Widget regularly, you pass the values as properties to Dropdown as shown here - https://github.com/zelenin/yii2-semantic-ui/blob/master/widgets/ActiveField.php#L87

When you use dropdownList as part of a field in a form, all those options are passed into $options which is never set to the properties therefore you can't use disabled/search/etc.

To replicate

<?= $form->field($model, 'foo')->dropDownList(['test' => 'foo'], ['disabled' => true]); ?>

The field won't be disabled.

Not sure if this is the best fix or moving the change to the individual classes like Dropdown

@zelenin
Copy link
Owner

zelenin commented Apr 9, 2016

Create $disabled like $multiple here https://github.com/iBotPeaches/yii2-semantic-ui/blob/bug/field-options/widgets/ActiveField.php#L86

I don't think that foreach in InputWidget is a good idea.

@iBotPeaches
Copy link
Author

Okay thanks for comment. I abstracted all variables used in Dropdown to that method.

@zelenin zelenin merged commit 509bc7f into zelenin:master Apr 11, 2016
@zelenin
Copy link
Owner

zelenin commented Apr 11, 2016

Cool. Thanks!

@iBotPeaches iBotPeaches deleted the bug/field-options branch April 11, 2016 15:09
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.

2 participants