-
Notifications
You must be signed in to change notification settings - Fork 1
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
Spreadsheet increase inputsize #100
base: simplystore
Are you sure you want to change the base?
Conversation
…lement in this context
…ng -> the save button needs to be visible
… 502 before merge.
www/assets/js/spreadsheet.js
Outdated
let columnDef = getColumnDefinition(el) | ||
let row = getRow(el) | ||
selector.innerHTML = '' | ||
selector.style.top = Math.max(2, (rect.top - offset.top))+'px' | ||
selector.style.left = (rect.left - offset.left)+'px' | ||
selector.style.width = rect.width+'px' | ||
selector.style.width = Math.max(300, (rect.width))+'px' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do Math.min(spreadsheetSize.width, Math.max(300, rect.width)+'px'
or Math.clamp if that exists
www/assets/js/spreadsheet.js
Outdated
const spreadsheetSize = spreadsheetElement.getBoundingClientRect(); | ||
const boxWidth = spreadsheetSize.width/1.618 // golden ratio | ||
const iconSize = 60 | ||
const standardBoxWidth = 300 + iconSize |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add a const minSize = 300 and use that everywhere
selector.style.left = (extraPadding) +'px' | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please extra code above to a separate function, e.g. calculateOptimalPosition
www/assets/js/spreadsheet.js
Outdated
} | ||
} else { | ||
|
||
selector.style.height = 'fit-content' | ||
selector.style.overflow = 'visible' | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If each branch of if/else has the same code, extract it outside the if/else branches
In addition: maybe add the height and top calculation to the earlier calculateOptimalPosition code and return a new object with { top, left, width, height } properties
Also set a maximum height to spreadsheet.height - select.style.top
Check the notes at line 498 and 502 in spreadsheet.js. And explain to Govert why that code is there please.