plotly / dash-table

OBSOLETE: now part of https://github.com/plotly/dash
https://dash.plotly.com
MIT License
419 stars 74 forks source link

Issue 660 - Increase `page_current` and `page_count` fields size to accommodate larger numbers #819

Closed Marc-Andre-Rivet closed 4 years ago

Marc-Andre-Rivet commented 4 years ago

Closes #660

alexcjohnson commented 4 years ago

This seems reasonable, but I wonder if these need to be fixed widths? Is it problematic to let them grow with their content?

Marc-Andre-Rivet commented 4 years ago

Inputs are weird beast and can't typically made to automatically grow with content, unlike other elements.

Typically this can be worked around by using something like <div contenteditable /> as the div will allow resizing - this won't automatically validate for numbers, etc. like the current field and you can actually start writing actual html into the div... I could also look into wrapping the input, position it absolutely + take all the available space, and use an identically styled span or div with the same content to force a resize - never used that method but I don't see any reason why it wouldn't work. I don't have a problem spending more time tweaking this into a more "dynamic" solution if we feel like it.

alexcjohnson commented 4 years ago

Ah right, number validation and other bits of <input> behavior are nice. What if we size both the input and the total page count to fixed widths but based on the number of digits in page_count instead of globally constant?

Marc-Andre-Rivet commented 4 years ago

Modified the proposed fix to:

image

image

pagination-large-no-count