suragch / mongol

Mongolian vertical script widgets for Flutter apps
https://pub.dev/packages/mongol
BSD 3-Clause "New" or "Revised" License
70 stars 15 forks source link

MongolTextField: cursor off-centered for empty text field when maxLines is null #39

Open suragch opened 1 year ago

suragch commented 1 year ago

The MongolTextField is off center when empty and maxLines is null:

wrong cursor position

After adding content the size changes and the cursor seems to fix itself (though the padding appears to be too wide):

better

This is observable in the example app.

Satsrag commented 8 months ago

This issue can be solved by setting minLines: 1

             MongolTextField(
                    style: const TextStyle(fontSize: 24),
                    controller: controller1,
                    maxLines: null,
                    minLines:1,
                    decoration: const InputDecoration(
                      border: OutlineInputBorder(),
                    ),
             )

This may be the reason that the MongolParagraph width is 0 when setting empty "". Paragraph seems to be width is not 0. but I'm not sure yet.