Skip to content

Commit

Permalink
Updated documentation and bumped package to v2.1.1 (#141)
Browse files Browse the repository at this point in the history
* Updated documentation and bumped package version (v2.1.1)

* CHANGELOG yep

* CHANGELOG syntax yep
  • Loading branch information
predikament authored Aug 20, 2024
1 parent 4a290ab commit 631bf3e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

# [2.1.1]
## Added
- new `init` config option `domNodeFocusOptions` for passing [FocusOptions](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus#parameters) when using `shouldFocusDOMNode`

# [2.1.0]
## Added
- new `init` config option `shouldUseNativeEvents` that enables the use of native events for triggering actions, such as clicks or key presses.
- new `init` config option `rtl` that changes focus behavior for layouts in right-to-left (RTL) languages such as Arabic and Hebrew.
- new `init` config option `rtl` that changes focus behavior for layouts in right-to-left (RTL) languages such as Arabic and Hebrew.

# [2.0.2]
## Added
Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,12 @@ Note that it is the developer's responsibility to make the elements accessible!
as it dives directly into the various html tags and how it complies with accessibility. Non-accessible tags like `<div>` needs to have the [tabindex](https://developer.mozilla.org/en-US/docs/Web/Accessibility/Keyboard-navigable_JavaScript_widgets) attribute set.
Also consider `role` and `aria-label` attributes. But that depends on the application.

The flag is ignored if `nativeMode` is set.
[FocusOptions](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus#parameters) can be set using the `domNodeFocusOptions` option documented below.

This flag is ignored if `nativeMode` is set to `true`.

##### `domNodeFocusOptions`: [FocusOptions](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus#parameters) (default: `{}`)
This object is passed to the `focus` method of the underlying _accessible_ DOM node when `shouldFocusDOMNode` is enabled.

### `shouldUseNativeEvents`: boolean (default: false)
This flag, when set to true, enables the use of native events for triggering actions, such as clicks or key presses. For instance, the onClick method will be triggered while pressing the enterKey, as well as cliicking the element itself. It is particularly beneficial for enhancing the accessibility of web applications. When shouldUseNativeEvents is active, the underlying accessible DOM node becomes the focus of the event.
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@noriginmedia/norigin-spatial-navigation",
"version": "2.1.0",
"version": "2.1.1",
"description": "React hooks based Spatial Navigation solution",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down

0 comments on commit 631bf3e

Please sign in to comment.