jspreadsheet / jspreadsheet/ce
JExcel + JSuites dropdown hidden in scrolling datagrid (+hacky fix)
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 7.2k
- Forks
- 890
- PR merge metrics
- No merged PRs in 30d
Description
While building a prototype jexcel grid that scrolls horizontally I came across an issue where when the jquites dropdown were hidden by the overflow. I implemented a hacky fix in jsuites.js that fixes it for us in jExcel, but it uses hardcoded element id's. I'm sure Paul could code a better solution, but it works for my purposes.
There's a video explanation here:
https://www.screencast.com/t/qunU3ESUu1
And the adjusted code in jsuites.js from line 2444 is
// #mod get jexcel datagrid
var grid = document.getElementById("maintool").querySelectorAll(".jexcel_content");
if (window.innerHeight < rect.bottom + rectContainer.height) {
container.style.top = (-1 * (rectContainer.height)) + 'px';
} else if(typeof(grid) !== 'undefined' && grid[0].offsetHeight - 100 < rect.bottom + rectContainer.height){
// if inside a scrolling grid make dropdown expand up.
container.style.top = (-1 * (rectContainer.height)) + 'px';
} else{
container.style.top = '';
}
This is using a hardcoded #maintool CSS id, so isn't really generic enough for all uses and no doubt could be improved.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in jsuites.js around line 2444 and reproduce the hidden-dropdown behavior in the horizontally scrolling jExcel grid described in the issue and video. Review the current hardcoded #maintool lookup and the surrounding positioning logic; done means the dropdown is positioned visibly in scrolling grids without relying on that specific element ID.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100