CJSCommonPlatform / govuk_single_page_pdk

Single Page Platform Development Kit
http://cjscommonplatform.github.io/govuk_single_page_pdk/
13 stars 20 forks source link

feature(search_component): add id and aria-describedby attributes #58

Closed LukaszKorzybski closed 7 years ago

scarlz commented 7 years ago

I am not sure this can be accepted as is... after compiling, the id applied to the component will exist twice – on both the component element and the inner input element. This would be invalid markup, and potentially problematic for people trying to use an id on this component as a unique selector in an end to end test.

As an alternative, you could strip the id from the outer element in the post link function so that it's moved from outer -> inner (though this may be slightly confusing behaviour for anyone not familiar with the component).

LukaszKorzybski commented 7 years ago

Maybe we can use inputId name then ? What do you think ?

scarlz commented 7 years ago

I think anything is fine so long as we don't have 2 x id. input-id seems reasonable.

LukaszKorzybski commented 7 years ago

Completely agree, I overlooked the fact that the component itself will be left with id param. I renamed it to inputId.

LukaszKorzybski commented 7 years ago

I added a new commit that introduces support for inline mode, required attribute on the input and minLength angular validation. Please check.