You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-11 20:22:36 +03:00
make DocumentOffset compatible with what is returned from dom/getCaret
so we can return a DocumentOffset from there without breakage
This commit is contained in:
@@ -15,12 +15,12 @@ limitations under the License.
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
export default class DocumentOffset {
|
export default class DocumentOffset {
|
||||||
constructor(offset, atEnd) {
|
constructor(offset, atNodeEnd) {
|
||||||
this.offset = offset;
|
this.offset = offset;
|
||||||
this.atEnd = atEnd;
|
this.atNodeEnd = atNodeEnd;
|
||||||
}
|
}
|
||||||
|
|
||||||
asPosition(model) {
|
asPosition(model) {
|
||||||
return model.positionForOffset(this.offset, this.atEnd);
|
return model.positionForOffset(this.offset, this.atNodeEnd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user