Skip to content

Commit 3bf3556

Browse files
committed
Changelog, docs, version bump
1 parent 9d08a16 commit 3bf3556

4 files changed

Lines changed: 14 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
# [1.2.0]
8+
## Added
9+
- new `init` config option `useGetBoundingClientRect` that affects the measurements of sizes and coordinates.
10+
711
# [1.1.5]
812
## Added
913
- Add `setThrottle` to dynamically change throttle time.

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,13 @@ Enables throttling of the key event listener.
241241
Works only in combination with `throttle` > 0. By default, `throttle` only throttles key down events (i.e. when you press and hold the button).
242242
When this feature is enabled, it will also throttle rapidly fired key presses (rapid "key down + key up" events).
243243

244+
##### `useGetBoundingClientRect`: boolean (default: false)
245+
This flag enables using `getBoundingClientRect` for measuring element sizes and positions. Default behavior is using DOM `offset` values.
246+
The difference is that `getBoundingClientRect` will measure coordinates and sizes post CSS transforms, while `offset` measurement will measure them pre CSS transforms.
247+
For example if you have an element with `translateX(50)`, the X position with the default measurement will still be 0, while `getBoundingClientRect` measurement will result in X being 50.
248+
The choice depends on how often you are using transforms, and whether you want it to result into coordinates shift or not.
249+
Sometimes you would want element to be *visually* translated, but its coordinates to be calculated as it was before the translation.
250+
244251
### `setKeyMap`
245252
Method to set custom key codes. I.e. when the device key codes differ from a standard browser arrow key codes.
246253
```jsx

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@noriginmedia/norigin-spatial-navigation",
3-
"version": "1.1.5",
3+
"version": "1.2.0",
44
"description": "React hooks based Spatial Navigation solution",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",

0 commit comments

Comments
 (0)