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

WIP Splitter component #1366

Closed
wants to merge 5 commits into from
Closed

WIP Splitter component #1366

wants to merge 5 commits into from

Conversation

stsrki
Copy link
Collaborator

@stsrki stsrki commented Oct 7, 2020

The first version of Splitter component #1360

The idea is to have a component that can be placed between any two elements(components) and it will resize them based on the mouse or touch move.

Usage

<SomeComponent1 />

<Splitter Orientation="Orientation.Horizontal" />

<SomeComponent2 />

@Jinjinov can you test this feature on your side so we can reuse it for DataGridColumn? I tried to place it in between table header cells but it's not working as expected. so far.

@Jinjinov
Copy link
Contributor

Jinjinov commented Oct 7, 2020

I will take a look when I find some free time :)

@Jinjinov
Copy link
Contributor

Jinjinov commented Oct 7, 2020

There might be a problem:

https://stackoverflow.com/questions/7051219/div-into-a-tr-is-it-correct

it is not valid. tr elements can only contain th and td elements. From the HTML4 specification:

@stsrki
Copy link
Collaborator Author

stsrki commented Oct 7, 2020

I suspected it already. 🤔 I will need to find a different way

@Jinjinov
Copy link
Contributor

Jinjinov commented Oct 7, 2020

another problem: if you use prev & next sibling then you can't resize the last column of the table

the solution that I used doesn't use siblings : https://htmldom.dev/resize-columns-of-a-table/

here is a solution that uses siblings: https://www.brainbell.com/javascript/making-resizable-table-js.html
but it first checks if the sibling exists

I checked again - actually it uses the sibling of the parent

@stsrki
Copy link
Collaborator Author

stsrki commented Oct 8, 2020

The solution for the last element is just to have a simple if statement and skip if it's null, the same thing for the first element.

Thank you for the link I will look at them :)

@stsrki stsrki changed the base branch from dev092 to dev093 November 17, 2020 10:08
@stsrki stsrki changed the base branch from dev093 to dev094 March 9, 2021 15:54
@stsrki stsrki closed this Mar 9, 2021
@stsrki stsrki deleted the dev092-splitter branch March 9, 2021 15:55
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.

2 participants