Draft-js: contentState.getEntityMap() doesn't return an ordered immutable map

Created on 20 Mar 2019  路  3Comments  路  Source: facebook/draft-js

Do you want to request a feature or report a bug?
Bug.
What is the current behavior?
const entityMap = contentState.getEntityMap()
entityMap .map((val, key) => console.log(val, key) )

returns the error message: entityMap.map() is not a function.

Similar issue as this: https://github.com/facebook/draft-js/issues/1264

It was closed, but it still occurs

image
image

What is the expected behavior?
contentState.getEntityMap() is supposed to return an ordered map of entities, according to:
https://draftjs.org/docs/api-reference-content-state#getentitymap.

Which is then supposed to be iterable as an immutable ordered map.

Which versions of Draft.js, and which browser / OS are affected by this issue? Did this work in previous versions of Draft.js?

Using firefox, Draft.js ^0.11.0-beta

bug v0-11-beta

Most helpful comment

v0.11.5 - the same issue.

All 3 comments

It would be nice to address in time for v0.11.0 as previously promised, but at the moment I have no idea what it would take to implement this.

v0.11.5 - the same issue.

v0.11.7 - the same issue.

Was this page helpful?
0 / 5 - 0 ratings