Skip to content

Latest commit

 

History

History
77 lines (51 loc) · 4.12 KB

CHANGELOG.md

File metadata and controls

77 lines (51 loc) · 4.12 KB

use-editable

2.3.3

  • Prevent empty text from being inserted (See 82ac3eb)
  • Prevent empty or negative ranges from being created for empty elements (See b79d013)

2.3.2

  • Fix missing backspace behaviour on opts.indentation for non-plaintext-only browsers (See 093b10e)

2.3.1

  • Fix Chrome quirk where initial focus would immediately lose its selected range by switching to selectstart and checking for window.getSelection().rangeCount (See 71ae9a2)

2.3.0

  • Add Edit#getState() method to returned Edit handle. useEditable returns the Edit object with several methods to allow manipulating the current editable. The getState() method allows you to retrieve the current text and position of the editable. (See 98cb706)

2.2.2

  • Fix regression from 2.2.1, which would misplace the indentation pattern and not recognise lines with content when backspace is pressed. (See bc2be15)

2.2.1

  • Add space-only indentation when opts.indentation is passed. This means that useEditable now inserts spaces over tabs when opts.indentation is set and overrides the default backspace behaviour to delete multiple spaces as needed. (See 9291f6c)

2.2.0

  • Add Edit#move() method to edit the caret position programmatically. The caret can now be moved to a specific character index or row/column coordinates. (See 15cea68)

2.1.2

  • Fix undo/redo key combination, which regressed previously, since it was switched to event.key rather than event.code (See 7147dca)
  • Fix changes from being flushed to eagerly, which was meant to preserve the selected ranges more eagerly (See 1feaec5)

2.1.1

  • Fix key repeats (held keys) not flushing changes correctly (See 3807bbf)

2.1.0

  • Support non-collpsed selection restoration, in other words, when a range is selected and the component updates in the meantime, the selection is restored correctly. This is achieved by storing the selection's "extent", i.e. the number of characters it selects past its start. (See a15f8fc)

2.0.2

  • Fix inconsistency of deletion behaviour on the beginning of lines. Due to the lack of plaintext-only support in Firefox, computing the current position would be relative to the root element, when plain text is selected. This makes it extremely difficult to get the current position without small offsets. (See 1644f51)

2.0.1

  • Fix onChange not being triggered when the cursor moves (See 9dfadda)

2.0.0

  • Add Edit return value to useEditable. The useEditable hook now returns an object with multiple methods that may be useful for controlling the editable's content, behaviour and cursor. Specifically it returns Edit#update, which was its previous return value for updating its content, and Edit#insert to append new text. (See c031d7e)