Opened 6 years ago

# Enabling the hide rule wide textarea fields are not automatically put on their own lines

Reported by: Owned by: sue.sml2006@… Rob Guttman normal DynamicFieldsPlugin normal Jan Beilicke, Ryan J Ollos 0.12

### Description

Using Trac 0.12.2, dynamic fields 1.2.1 I have a 60 column wide textarea field that ends up in the right hand column either in the yellow "view ticket" area or in "modify ticket" area (but never both at the same time) when I have the hide rule enabled. Doesn't seem to matter if i'm using the hide_always rule or not, just enabling the rule causes this strangeness. Attaching two screenshots, only difference is enabling the hide component.

### Changed 6 years ago by sue.sml2006@…

modify area when hide is disabled (i.e. how it should look)

### Changed 6 years ago by sue.sml2006@…

modify area when hide is disabled (i.e. how it should look)

### Changed 6 years ago by sue.sml2006@…

when hide is enabled, the "investigation_notes" field ends up in the right hand column

### comment:1 Changed 6 years ago by sue.sml2006@…

I've been able to hide fields using the blackmagictweaks plugin, but your hide_always option works much better for hiding from query pages, so I would prefer to get this working if possible.

### comment:2 Changed 6 years ago by Jan Beilicke

Cc: Jan Beilicke added; anonymous removed

Workaround

### comment:3 Changed 6 years ago by Ruth Trevor-Allen

I had this problem too. I found that disabling the bit of code that re-calculates layout when fields are hidden made it go away. Although not a perfect solution, this is a reasonable workaround. Simply delete or comment out the following lines from htdocs/layout.js:

        // get new field order
var new_fields = jQuery.merge(visible, hidden); // warning: side-effects!

// order the fields
this.order_fields(new_fields);


Diff attached.

### comment:4 Changed 6 years ago by Rob Guttman

Sue et al, I see. As @fleeblewidget figure out, I dynamically change the layout to fill gaps left by hidden fields. I've never used textarea custom fields before - I didn't even know they were available! - and so missed this when designing the layout algorithm.

It seems textarea fields need to enjoy their own row and not be crammed into one column or the other. I'll see if I can change the layout algorithm to accommodate.

### comment:5 Changed 6 years ago by Rob Guttman

(In [11002]) refs #8971: now handles layout of textarea custom fields.

### comment:6 Changed 6 years ago by Rob Guttman

Resolution: → fixed new → closed

Sue / fleeblewidget - I think I may have solved this one. Please give it a try and let me know. Reopen this ticket if it's not quite right for you.

### comment:7 Changed 6 years ago by sue.sml2006@…

Hi Rob, I finally got around to trying this and I dont see any change, I'm not sure I've included your code correctly. The fields still end up in the wrong spot as soon as i enable the hiderul. I am using a shared plugins folder, and I downloaded the latest plugin into my main projects plugins directory and ran setup.py install again, is it possible it's using some cached version of the plugin? how can I ensure it's using the latest? Thanks, sue

### comment:8 follow-up:  9 Changed 6 years ago by sue.sml2006@…

Hi Rob, I was able to use fleeblewidget's workaround. For whatever reason, any update you implemented did not fix the problem (I did figure out how to ensure my plugin was not cached)

### comment:9 in reply to:  8 Changed 4 years ago by anonymous

Resolution: fixed closed → reopened

Hi Rob, I was able to use fleeblewidget's workaround. For whatever reason, any update you implemented did not fix the problem (I did figure out how to ensure my plugin was not cached)

Same problem. Will reopen.

### comment:10 Changed 4 years ago by Ryan J Ollos

In 13650:

Bump version to 1.2.4. Refs #11378, #11118, #11523, #10126, #9605, #9986, #9996, #8971.

### comment:11 Changed 3 years ago by anonymous

I am using version 2.2.0 of the plugin, with Trac 1.0.1, and I think I am experiencing the same thing. My situation looks like the attached screen shots.

More detail:

• If I have a textarea custom field that has EXACTLY an even number of fields that are displayed prior to it (laid out above it) in the edit area of the ticket, then things behave. If I have an ODD number of fields above, then the textarea doesn't jump to a new row; I tried several variations and even saw it become the third column (<TD>) in the HTML row at one point. If I turn off the plugin, this behavior doesn't happen, this textarea that is 60 characters wide always gets to start a new row.
• Even if I have an exact even number of fields laid out above this textarea, any time that the plugin causes any field to be hidden (using the hide rule), then the textarea misbehaves in the same way. In other words, if any field is hidden, I see the layout error, whether having an even or odd count of prior fields shown in the edit area.

### comment:12 Changed 3 years ago by Ryan J Ollos

Cc: Ryan J Ollos added

### Modify Ticket

Change Properties