-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(checkbox): remove native control from getters/setters of foundation #3408
Merged
Merged
Changes from 4 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
c92d48b
WIP: remove nativeCB from getter/setters in foundatoin
f088517
WIP: test
e3c7c9d
WIP: fix test
ecd0520
Merge branch 'master' into fix/checkbox/remove-native-control
ba823fa
Update foundation.js
b99202f
Merge branch 'master' into fix/checkbox/remove-native-control
ad97f84
Merge branch 'master' into fix/checkbox/remove-native-control
williamernest 1ee6735
WIP: fix test
0f7fecc
WIP: checkbox
4ac34a7
WIP: readme updates
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -88,39 +88,59 @@ class MDCCheckbox extends MDCComponent { | |
registerChangeHandler: (handler) => this.nativeCb_.addEventListener('change', handler), | ||
deregisterChangeHandler: (handler) => this.nativeCb_.removeEventListener('change', handler), | ||
getNativeControl: () => this.nativeCb_, | ||
isIndeterminate: () => this.isIndeterminate_(), | ||
isChecked: () => this.isChecked_(), | ||
hasNativeControl: () => !!this.nativeCb_, | ||
setNativeControlDisabled: (disabled) => this.nativeCb_.disabled = disabled, | ||
forceLayout: () => this.root_.offsetWidth, | ||
isAttachedToDOM: () => Boolean(this.root_.parentNode), | ||
}); | ||
} | ||
|
||
/** | ||
* @return {boolean} | ||
* @private | ||
*/ | ||
isIndeterminate_() { | ||
return this.nativeCb_.indeterminate; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we move these to the |
||
} | ||
|
||
/** | ||
* @return {boolean} | ||
* @private | ||
*/ | ||
isChecked_() { | ||
return this.nativeCb_.checked; | ||
} | ||
|
||
/** @return {!MDCRipple} */ | ||
get ripple() { | ||
return this.ripple_; | ||
} | ||
|
||
/** @return {boolean} */ | ||
get checked() { | ||
return this.foundation_.isChecked(); | ||
return this.isChecked_(); | ||
} | ||
|
||
/** @param {boolean} checked */ | ||
set checked(checked) { | ||
this.foundation_.setChecked(checked); | ||
this.nativeCb_.checked = checked; | ||
} | ||
|
||
/** @return {boolean} */ | ||
get indeterminate() { | ||
return this.foundation_.isIndeterminate(); | ||
return this.isIndeterminate_(); | ||
} | ||
|
||
/** @param {boolean} indeterminate */ | ||
set indeterminate(indeterminate) { | ||
this.foundation_.setIndeterminate(indeterminate); | ||
this.nativeCb_.indeterminate = indeterminate; | ||
} | ||
|
||
/** @return {boolean} */ | ||
get disabled() { | ||
return this.foundation_.isDisabled(); | ||
return this.nativeCb_.disabled; | ||
} | ||
|
||
/** @param {boolean} disabled */ | ||
|
@@ -130,12 +150,12 @@ class MDCCheckbox extends MDCComponent { | |
|
||
/** @return {?string} */ | ||
get value() { | ||
return this.foundation_.getValue(); | ||
return this.nativeCb_.value; | ||
} | ||
|
||
/** @param {?string} value */ | ||
set value(value) { | ||
this.foundation_.setValue(value); | ||
this.nativeCb_.value = value; | ||
} | ||
|
||
destroy() { | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You accidentally deleted
mixed
somehow