-
Notifications
You must be signed in to change notification settings - Fork 74
Description
Describe your motivation
A while ago, we started using the Spreadsheet Component for the following use cases:
- Displaying the contents of Read-Only Excel-Files
- Editing Worksheet-Properties (writing to and from XSSFWorkbooks saved as Base64-Strings)
Currently, the biggest problem with using the Component is preventing the user from entering values, when they shouldn't, like in the file preview or when viewing unmodifiable datasets.
Currently, this can only be achieved by Password-locking the Sheets of the Workbook, which has the following problems:
- Locking the sheets modifies the Workbook, resulting in different Base64, so our Editor fires a value change
- Password-Locking the sheets does not prevent new Sheets from being created
- After locking the sheets, a component reload is required, which causes the UI to flicker every time
Another way of preventing user input, we have tried is setting the inert attribute and preventing pointer events. This however kills all interactions, leaving the user unable to select cells or change the sheet on multi-page Spreadsheets.
Describe the solution you'd like
There needs to be a way of setting a Spreadsheet to read-only, separate from the internal Workbook.
A read-only Spreadsheet prevents all interactions that would modify the Workbook, like adding/removing comments and sheets, pasting/writing text, drag-filling cells, etc.
Setting a Spreadsheet to read-only is not synced with the Workbook, it's just the state of the Vaadin component.
Describe alternatives you've considered
- Password-Locking Sheets
- Element
inertattribute and stylepointer-events: none
see above for why this did not work
Additional context
- Originally falsely reported as a bug in Spreadsheet: Read-only and disabled behavior #6413, I closed that issue in favor of this feature request