Add new beforeColumnWrap
and beforeRowWrap
hooks
#10550
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context
The PR fixes an issue related to unfocusing the table using Tab key when the NestedHeaders plugin was enabled. To fix the error, it was necessary to introduce new hooks that help determine when the moment of row wrapping occurs.
beforeRowWrap
hookbeforeColumnWrap
hookHooks' arguments
isWrapEnabled
: The argument tells whether the row and/or column wrapping is going to happen. There may be situations where the option does not work even though it is enabled. This is due to the priority of other options that may block the feature. For example, when theminSpareRows
is defined, theautoWrapCol
option is not checked. Thus, column wrapping is off;newCoords
may help determine what cell will be focused on after the wrapping operation;isFlipped
is set totrue
when the user reaches the last row/column, and the focus is moved to the first row/column or vice versa,false
otherwise.Miscellaneous changes
The two new methods were added to the
CellCoords
class. This includes:isRtl()
that allows checking if the coordinates running in RTL layout direction mode;assign()
that allows assigning coordinates from anotherCellCoords
instance or from a literal object that is compatible withCellCoords
schema (hasrow
and/orcol
properties).How has this been tested?
Types of changes
Related issue(s):
Affected project(s):
handsontable
Checklist: