question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Setting AllowsTab in TextView disables Multiline

See original GitHub issue

It seems that turning off ‘AllowsTab’ setting in TextView also disables Mutliline. Is this a bug or is there a there a reason why we can’t have a multi line editor where tab insertion is disabled?

[Fact]
public void TextView_MultiLineButWithoutTabs()
{
	var view = new TextView ();
	
	// the default for TextView
	Assert.True (view.Multiline);

	view.AllowsTab = false;
	Assert.False (view.AllowsTab);

	Assert.True (view.Multiline); // crashes here
}

To me AllowsTab should be whether when the user presses TAB a tab gets inserted. So the rendering/layout would be standard regardless of this setting (e.g. \t is tabWidth spaces).

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:13

github_iconTop GitHub Comments

1reaction
tznindcommented, Jul 19, 2021

For sure there is a lot of bugs because of this.

Yes having turned a pure enum into [Flags] like this sounds dangerous. Can you do a minimum repro unit test of how we are currently checking the property and how it results in ambiguity? Maybe as a new issue?

1reaction
BDispcommented, Jul 19, 2021

I found a solution for this by using Equals.

e.KeyEvent.Key.Equals (Key.Q | Key.CtrlMask)

Edit: It’s enough using the == keyword.

e.KeyEvent.Key == (Key.Q | Key.CtrlMask)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Multiline TextView in Android?
I was trying to get multi line textviews in my slide-drawer menu ... Simply set the inputType and the TextView will adapt to...
Read more >
How do I set the multiple lines in TextView Android Studio?
If you want the TextView to always have four lines regardless of the length of the text in it, set the android:lines attribute:...
Read more >
Android multiline TextView with accurate width
In short, the TextView thinks: well, there is not enough the maximum allowed by parent width to render the entire text so I...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found