Repository navigation
Releases: mbraak/tree-element
Releases · mbraak/tree-element
Release list
v0.4.0
v0.3.2
Changed
- The default
closedIconandopenedIcontriangles are larger and have the
same width and height, like the triangle characters they replaced.
v0.3.1
Fixed
- A relative
dataUrl, such asapi/nodes.json, is resolved against the page
instead of the root of the site. This makes it work when the page is in a
subdirectory, for example on GitHub Pages. - The default
closedIconandopenedIconare now svg triangles instead of
text characters. This make sure they are the same on all platforms.
v0.3.0
Added
- The keys
HomeandEndselect the first and the last visible node. - The key
Enterdispatches the new eventtree.activate, for example to open
the edit page of the node. - The options
ariaLabelandariaLabelledBygive the tree an accessible name. - The colors in
tree_element.cssare css custom properties, such as
--tree-element-title-color, so you can change them or add a dark theme. See
Styling. - A folder's treeitem has
aria-busy="true"while its children load.
Fixed
- The tree can be reached with the tab key when no node is selected.
- Do not set
aria-labelfor tree nodes. Rely on the node text instead. - Screen readers no longer read the open/close toggler. It has
aria-hidden="true";aria-expandedon the node already has the state. - When loading the children of a folder fails, the tree no longer requests them
again and again. The folder stays closed; opening it again retries.
Changed
- The toggler and the rows are at least 24px high, and the toggler is at least
24px wide: the WCAG 2.5.8 minimum for click targets. This makes the tree a
bit taller. The toggler no longer has a margin; the space around its icon
separates it from the title. - The toggler is a
spaninstead of anawithouthref. Update css that
selectsa.tree-element-toggler. - When the user prefers reduced motion (
prefers-reduced-motion: reduce),
folders open and close without animation, unlessanimationSpeedis set. - The method
selectNodekeeps an already selected node selected, as
documented. - The methods
closeNodeandtogglereturn a promise that is resolved when
the folder is closed or opened, likeopenNode. Await it when you need to
know the animation has finished.
v0.2.0
Fixed
- The options
closedIconandopenedIconrender a string as html instead of
as text.
Changed
- Make rendering faster by using templates.
- The children of a closed folder are rendered when the folder is opened,
instead of when the tree is rendered.onCreateLiis called for a node when
it is rendered. - The method
getSelectedNodereturns null instead of false. - The method
setStatesaves the state to storage whensaveStateis enabled.
v0.1.1
Changed
tree.load_failedis also dispatched when a request fails with a network error.