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

Some suggestions #1

Open
zwz opened this issue Mar 24, 2023 · 6 comments
Open

Some suggestions #1

zwz opened this issue Mar 24, 2023 · 6 comments

Comments

@zwz
Copy link

zwz commented Mar 24, 2023

I like this module. I tried the demo, and here are some suggestions:

  1. set column width with percentage value. AFAIK, pandoc only treats <col> with percentage width value. And percentage value is good for fitting to various-size screens. So I would suggest set data-colwidth of td to percentage value as well (data-colwidth="80" means it takes 80% of width)
    BTW: I cannot adjust the size in Firefox. This exists for a long time from prosemirror-tables.

  2. improve cursor movement. If I move the cursor with up/down arrow key in the demo, it will skip table caption(both keys in firefox, only up key in chrome). And if I move the cursor out of table caption by right arrow key in firefox, it jumps out of the table. And if you hit tab key at the end of thead/tbody, it will select the next whole tbody, which I think is not expected.

  3. customizable schema. I would like to customize the content of the table, like a required table caption instead of an optional one.

@massifrg
Copy link
Owner

Thank you for your feedback.
Column widths are the last thing I managed to set (almost) right, because the way prosemirror-tables-sections creates the colgroup element is different (through Decorations) from prosemirror-tables (a custom EditorView).
I preferred publishing it earlier to get some feedback :)
I agree that percentages are more useful.

I'll look at cursor movement.

You can already define a different schema with a required caption.
prosemirror-tables defines table roles (the tableRole field in the schema), so that you can change the names of the nodes;
you can call the table node of your schema "myTable" instead of "table", but it will behave as a table as long as its tableRole is "table". The other roles are "row" (tr), "cell" (td), "header_cell" (th). I've added the "table_caption" (caption) and "table_section" (thead, tbody and tfoot) roles.

@zwz
Copy link
Author

zwz commented Mar 25, 2023

Yes, if colgroup is inherent in the schema, then there is no need to keep the data-colwidth for each cell.

Anyway, thank your for your work.

@massifrg
Copy link
Owner

Cursor and tab keys should work better now.
I still don't like the behavior of SHIFT+cursor when started inside the caption, but I'll leave it for future improvements.
Column resizing is not perfect but workable.

@zwz
Copy link
Author

zwz commented Apr 6, 2023

Yes, it is better now!

I cannot test column resizing in firefox, it is not available for a long time from prosemirror-tables.

1 similar comment
@zwz
Copy link
Author

zwz commented Apr 6, 2023

Yes, it is better now!

I cannot test column resizing in firefox, it is not available for a long time from prosemirror-tables.

@massifrg
Copy link
Owner

massifrg commented Apr 6, 2023

I'm using firefox 102.9.0esr (64 bit) in Debian GNU/Linux 11 and column resizing works.
You could try firefox in a different environment (another user) or disable extensions selectively.

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

No branches or pull requests

2 participants