https://github.com/cvan/offline-search
https://github.com/cvan/offline-search
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/cvan/offline-search
- Owner: cvan
- License: mit
- Created: 2014-09-09T07:27:31.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2014-09-09T07:27:43.000Z (almost 12 years ago)
- Last Synced: 2025-03-24T09:50:19.571Z (about 1 year ago)
- Language: JavaScript
- Size: 383 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# flexbox-sort
Sort a list of nodes without changing the DOM (thank you, flexbox).
The perfect use case: rendering filtered data, such as client-side search
results, without having to reconsistute the DOM based on sort order.
Instead of physically rearranging the existing DOM nodes,
or destroying the existing nodes and re-rendering new ones, we
can simply change them using one CSS property (flexbox's `order`).
## Caveat
If you copy the entire document to your clipboard, you'll notice that the
pasted text appears in the order in which the text is represented in the DOM,
not in the visual order set by flexbox.
You can still select the text content of each flexbox-ordered item - just not
text that overlaps to another flexbox-ordered item.
If you print the document, the visual order set by flexbox order is
preserved. But why are you printing this? And why do you still own a printer?
## Browser support
* Chrome (any)
* Firefox (any)
* Safari (any)
* Opera 12.1+
* IE 10+
* iOS (any)
* Android (any)
## Closing remark
Sic transit gloria.