Skip to content

[BUG]: Dynamic height does not workΒ #342

@TrevPennington

Description

@TrevPennington

Describe the bug
Setting dynamicHeight to true does not do anything.
If this doesn't work, is there a way to read the height of the content?

To Reproduce
Steps to reproduce the behavior:

  1. Set dynamicHeight to true
  2. Height is not dynamic
 "@10play/tentap-editor": "^1.0.1",
 "expo": "53.0.20"
import { RichText, useEditorBridge } from '@10play/tentap-editor';
import Text from '../small/Text';
import View from '../small/View';

export const DynamicRT = () => {
  const editor = useEditorBridge({
    dynamicHeight: true,
    autofocus: true,
    theme: {
      webview: {
        backgroundColor: 'red',
      },
    },
  });

  return (
    <View className="pt-safe flex-1 bg-ivory-200">
      <View className="min-h-[30px]">
        <RichText
          editor={editor}
          onLayout={(e) => {
            console.log('layout', e.nativeEvent.layout.height);
          }}
        />
      </View>
      <Text>No dynamic height 😭</Text>
    </View>
  );
};

Expected behavior
Height should grow as content grows.

Screenshots
https://github.com/user-attachments/assets/7d9d7014-4a96-40ee-81c2-915e471a4e3e

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions