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] Make editable cells fill cells vertically #1673

Merged
merged 4 commits into from Oct 6, 2017

Conversation

gscshoyru
Copy link
Contributor

Fixes #1235

Changes proposed in this pull request:

Make some style modifications to the surrounding div of the editable text, with a new class, to make it always horizontally fill the cell. Double-clicking anywhere in the cell will open the input now, and it takes up the whole space.

Reviewers should focus on:

Is position: absolute really the best way of doing this? I'm not happy with it, but I couldn't come up with anything better.

@cmslewis cmslewis changed the title Make editable cells fill cells horizontally [Table] Make editable cells fill cells horizontally Oct 5, 2017

private invokeCallback(callback: (value: string, rowIndex?: number, columnIndex?: number) => void, value: string) {
// pass through the row and column indices if they were provided as props by the consumer
// const { columnIndex } = this.props;
Copy link
Contributor

Choose a reason for hiding this comment

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

delete commented code?

this.invokeCallback(this.props.onConfirm, value);
};

private invokeCallback(callback: (value: string, rowIndex?: number, columnIndex?: number) => void, value: string) {
Copy link
Contributor

Choose a reason for hiding this comment

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

These callback params look inconsistent with the ones in the props interface above.

In the props interface: value, columnIndex
Here: value, rowIndex, columnIndex

top: 0;
right: 10px;
bottom: 0;
left: 10px;
Copy link
Contributor

Choose a reason for hiding this comment

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

Are these offsets not accomplished with padding within the editable text component itself?

Also, probably want to use $pt-grid-size. // CC @llorca

Copy link
Contributor

Choose a reason for hiding this comment

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

+1 use $pt-grid-size

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So the issue here is that if I use padding it messes up the ::before absolutely positioned element that shows up to make the input the right size, and messing with those values messes with the editable headers.

I'll do it the other way, though.

@gscshoyru
Copy link
Contributor Author

Gah, my bad, that file shouldn't be in the PR in the first place, was something else I was working on. Whoops.

@blueprint-bot
Copy link

Undo spurious added file

Preview: documentation | table
Coverage: core | datetime

@blueprint-bot
Copy link

Better way to style things

Preview: documentation | table
Coverage: core | datetime

@gscshoyru gscshoyru changed the title [Table] Make editable cells fill cells horizontally [Table] Make editable cells fill cells vertically Oct 6, 2017
}

&.bp-table-editable-text {
&::before {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd merge this selector onto line above, but whatever 👍 &.bp-table-editable-text::before

&::before {
top: -$cell-padding-vertical + $cell-border-width - 1px;
right: $cell-border-width;
bottom: -$cell-padding-vertical + 1px;
Copy link
Contributor

Choose a reason for hiding this comment

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

seems like top and bottom and cursor don't change from selector above. maybe they can be removed from this block, since it necessarily matches the selector above as well?

Copy link
Contributor

@themadcreator themadcreator left a comment

Choose a reason for hiding this comment

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

they don't support wrapping right? i thought editabletext could do multiline but when i turn on wrap, it doesn't.

top: 0;
right: 0;
bottom: 0;
left: 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

classic absolute fill. why isnt this a blueprint style or sass mixin yet?

Copy link
Contributor

@llorca llorca Oct 6, 2017

Choose a reason for hiding this comment

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

@include position(absolute, 0)

Copy link
Contributor

Choose a reason for hiding this comment

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

bourbon!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So far as I can tell, this thing doesn't exist, or at least SASS was unhappy with it

Copy link
Contributor

@giladgray giladgray Oct 6, 2017

Choose a reason for hiding this comment

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

it's a bourbon mixin. search codebase for other usages. but don't block this PR on it cuz #875. http://bourbon.io

Copy link
Contributor

Choose a reason for hiding this comment

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

ack

@blueprint-bot
Copy link

Remove unnecessary

Preview: documentation | table
Coverage: core | datetime

top: 0;
right: 0;
bottom: 0;
left: 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

ack

@cmslewis
Copy link
Contributor

cmslewis commented Oct 6, 2017

:shipit:

@cmslewis cmslewis merged commit e1f2c3d into master Oct 6, 2017
@cmslewis cmslewis deleted the gsc/make-editable-cells-fill-cells branch October 6, 2017 22:30
@cmslewis cmslewis mentioned this pull request Oct 6, 2017
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.

None yet

6 participants