This utility is used by default when removing tags and helps with modifying the tag list. RemoveTagsByIndices: (tags, indices): tags This value is consumed by SlateJS editor embedded inside TagsInput. ParseValue: (tags, query, prevValue): ValueĬreates SlateJS Value and maintains Selection. This factory function is called by default within the input. createPluginsįactory function for initializing all default plugins. Plugin that parses incoming tag and query props into SlateJS value representation. Plugin that enables navigation with cursor arrows between tag nodes so empty nodes between tag nodes are skipped. It also triggers callbacks when tag should be added or removed, either via mouse or keyboard. The plugins are created as classes so you need to call plugin.initialize() before passing them to the input. These plugins are used by default with the input. Object containing default SlateJS plugins used with TagsInput. ![]() See CollapsibleTagsInput API TagComponentĭefault React component that renders tag items. The component searches through editor nodes to calculate visible tag nodes which is specified by configuration and CSS. This component allows for passing callbacks that are triggered when input is blurred / focused and mounted. React component that renders TagsInput internally. This is useful if you change the tag input dynamically or apply other styles. Instead of relying on offsetTop position of first Tag node, this offset is used. The number of these nodes is used as count argument. Then other tag components' offsetTop properties are observed and those that do not match are considered to be hidden nodes. The callback passes count argument which is the amount of Tag nodes that are of different top offset (the offset can be specified via offset prop).īy default the initial offset is calculated by looking at first Tag node offsetTop property. Additionaly it is called when the input is mounted. The callback is triggered every time the input is focused or blurred. You can pass the same props as for TagsInput component. The callback is called at the end of componentDidMount. This callback is triggered once the query and tags are parsed and the internal editor value is generated, basically after the editor's internal state is set and first render occurs. If you need to set reference to the editor itself, you can use this function to set it. ![]() Tag is a javascript object that contains data and metadata describing it: )Īny time any of input's internal editor value is changed this callback is triggered. The input renders tats first and then the query is rendered as last. The tags that are rendered inside the input. The text value of the input which is created by user typing via keyboard. This componenty needs to be controlled from outside in order to work correctly. React input component for displaying tags.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |