Skip to content
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

[Table] scrollToRegion instance method #1496

Merged
merged 30 commits into from
Aug 28, 2017
Merged
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
f661262
Delete commented code
cmslewis Aug 22, 2017
bd91c72
Add method stub
cmslewis Aug 22, 2017
c4d9f6b
Initial implementation
cmslewis Aug 22, 2017
9e694ab
[TEMPORARY?] Add instance to the window object
cmslewis Aug 22, 2017
70a8bb5
Make auto-scrolling work; fix syncViewportPosition bug
cmslewis Aug 23, 2017
bd1c170
Handling for frozen rows/columns
cmslewis Aug 23, 2017
f65c8f4
Fix scroll-correction logic
cmslewis Aug 23, 2017
0ad4d8a
Add instance method to TableQuadrantStack
cmslewis Aug 24, 2017
33bb63b
Refactor logic into new scrollUtils.ts
cmslewis Aug 24, 2017
b4cf85e
Create new common/internal folder
cmslewis Aug 24, 2017
cc7b908
Fix scroll misalignment bug
cmslewis Aug 24, 2017
fcb8aed
Don't correct if scroll is disabled
cmslewis Aug 24, 2017
2c29b21
Prevent programmatic scrolling when scrolling disabled
cmslewis Aug 24, 2017
a29f832
Remove need for Grid in scrollUtils file
cmslewis Aug 24, 2017
a87242d
Fix off-by-one bug
cmslewis Aug 24, 2017
5cbf3b6
Add scrollTo controls to the table example
cmslewis Aug 24, 2017
ca9be6b
Fix lint
cmslewis Aug 24, 2017
f5080e4
Delete animated param for now
cmslewis Aug 24, 2017
28fcb52
Delete window instance
cmslewis Aug 24, 2017
9d1d9f1
Delete console.logs
cmslewis Aug 24, 2017
5281104
Revert changes RE: prereqStateKeyValue
cmslewis Aug 24, 2017
839c027
Delete unintentional cnewline
cmslewis Aug 24, 2017
89b7b05
Write tests for scrollUtils
cmslewis Aug 24, 2017
da186b5
Fix lint again
cmslewis Aug 25, 2017
dfb5a9c
Write tests in table too
cmslewis Aug 25, 2017
26b4fc8
Added docs, new 'Instance methods' section
cmslewis Aug 25, 2017
70ca679
Update stuff per CR feedback
cmslewis Aug 25, 2017
f21b683
Oops, revert changes to table example
cmslewis Aug 25, 2017
ec3e915
Fix stuff per bdwyer CR
cmslewis Aug 26, 2017
80dfb99
Merge branch 'master' into cl/table-scroll-to-position
cmslewis Aug 28, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Revert changes RE: prereqStateKeyValue
  • Loading branch information
cmslewis committed Aug 24, 2017
commit 5281104b4ab5faa3fa951187b9b7d8e600223f75
14 changes: 7 additions & 7 deletions packages/table/preview/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -557,9 +557,9 @@ class MutableTable extends React.Component<{}, IMutableTableState> {
label: string,
stateKey: keyof IMutableTableState,
prereqStateKey?: keyof IMutableTableState,
prereqStateKeyValues?: any[],
prereqStateKeyValue?: any,
) {
const isDisabled = !this.isPrereqStateKeySatisfied(prereqStateKey, prereqStateKeyValues);
const isDisabled = !this.isPrereqStateKeySatisfied(prereqStateKey, prereqStateKeyValue);

const child = <Switch
checked={this.state[stateKey] as boolean}
Expand All @@ -570,7 +570,7 @@ class MutableTable extends React.Component<{}, IMutableTableState> {
/>;

if (isDisabled) {
return this.wrapDisabledControlWithTooltip(child, prereqStateKey, prereqStateKeyValues);
return this.wrapDisabledControlWithTooltip(child, prereqStateKey, prereqStateKeyValue);
} else {
return child;
}
Expand Down Expand Up @@ -612,9 +612,9 @@ class MutableTable extends React.Component<{}, IMutableTableState> {
generateValueLabel: (value: any) => string,
handleChange: IMutableStateUpdateCallback,
prereqStateKey?: keyof IMutableTableState,
prereqStateKeyValues?: any[],
prereqStateKeyValue?: any,
) {
const isDisabled = !this.isPrereqStateKeySatisfied(prereqStateKey, prereqStateKeyValues);
const isDisabled = !this.isPrereqStateKeySatisfied(prereqStateKey, prereqStateKeyValue);

// need to explicitly cast generic type T to string
const selectedValue = this.state[stateKey].toString();
Expand Down Expand Up @@ -642,7 +642,7 @@ class MutableTable extends React.Component<{}, IMutableTableState> {
);

if (isDisabled) {
return this.wrapDisabledControlWithTooltip(child, prereqStateKey, prereqStateKeyValues);
return this.wrapDisabledControlWithTooltip(child, prereqStateKey, prereqStateKeyValue);
} else {
return child;
}
Expand All @@ -662,7 +662,7 @@ class MutableTable extends React.Component<{}, IMutableTableState> {
) {
// Blueprint Tooltip affects the layout, so just show a native title on hover
return (
<div title={`Requires ${prereqStateKey} to match one of ${prereqStateKeyValue.toString()}`}>
<div title={`Requires ${prereqStateKey}=${prereqStateKeyValue}`}>
{element}
</div>
);
Expand Down