Skip to content
This repository has been archived by the owner on Oct 31, 2018. It is now read-only.

bug in renderEditor.template - g:select - 'class' attribute written twice in several places #80

Open
pbb6w7 opened this issue Mar 16, 2014 · 1 comment

Comments

@pbb6w7
Copy link

pbb6w7 commented Mar 16, 2014

The class="form-control" is overwritten (if I may use the term as its not exactly on override) in the following places causing the g:select tag to render only the second class element. For the lines outlined below the form-control needs to be incorporated in the appropriate following line. The current code cause the g:select tag to ignore the class="form-control"

One:

private renderManyToOne(domainClass,property)
line:95
sb << '<g:select class="form-control"'
overwritten by:
line:103
sb << ' class="many-to-one"'

Two:

private renderManyToMany(domainClass, property) 
line:120
sb << '<g:select class="form-control" name="' << property.name << '"'
overwritten by:
line:127
sb << ' class="many-to-many"'

Three:
a)

private renderNumberEditor(domainClass, property) 
line:153
return "<g:select class='form-control' name=\"${property.name}\" from=\"\${-128..127}\" class=\"range\" value=\"\${fieldValue(bean: ${domainInstance}, field: '${property.name}')}\" />"
class='form-control' 
overwritten by:
class=\"range\"

b)

line:160:
sb << '<g:select class="form-control" name="' << property.name << 
overwritten by:
line:162
sb << ' class="range"'
@pbb6w7
Copy link
Author

pbb6w7 commented Mar 16, 2014

I should probably clarify - the way the renderEditor.template is right now it renders the <g:select ...>
tag with two class attributes and the first one seems to be ignored (for example the many-to-many):

<g:select  class="form-control" name="name" from="form" multiple="multiple" optionKey="id" size="5" required="" value="value" class="many-to-many"/>

where the

class="form-control"

appears in the beginning of the tag, and the

class="many-to-many"

appears at the end. The browser then seems to disregard the first class attribute (granted tested only in Chrome)

jakobklein pushed a commit to jakobklein/KickstartWithBootstrap that referenced this issue Sep 26, 2014
bug: sometime "class"-attribute is set multiple times (chrome omits one of them).
fixed: all classes are written in the same attribute.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant