Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pattern and autocomplete properties #601

Merged
merged 3 commits into from
Oct 10, 2018

Conversation

bryanforbes
Copy link
Member

Type: feature

The following has been addressed in the PR:

  • There is a related issue
  • All code matches the style guide
  • Unit or Functional tests are included in the PR

Description:

Adds pattern and autocomplete properties and passes them through to the <input> node

Resolves #553

@bryanforbes bryanforbes requested a review from agubler October 2, 2018 22:21
@codecov
Copy link

codecov bot commented Oct 2, 2018

Codecov Report

Merging #601 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #601      +/-   ##
==========================================
+ Coverage   98.94%   98.95%   +<.01%     
==========================================
  Files          42       42              
  Lines        3043     3053      +10     
  Branches      820      823       +3     
==========================================
+ Hits         3011     3021      +10     
  Misses         32       32
Impacted Files Coverage Δ
src/text-input/index.ts 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b97596f...52906c9. Read the comment docs.

@@ -52,7 +54,7 @@ export const ThemedBase = ThemedMixin(WidgetBase);
'labelAfter',
'labelHidden'
],
attributes: [ 'widgetId', 'label', 'placeholder', 'controls', 'type', 'minLength', 'maxLength', 'value', 'name' ],
attributes: [ 'widgetId', 'label', 'placeholder', 'controls', 'type', 'minLength', 'maxLength', 'value', 'name', 'pattern', 'autocomplete' ],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pattern will have to be a property if it's not just a string.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I talked with @matt-gadd today and that doesn't seem to be the case

@@ -33,6 +33,8 @@ export interface TextInputProperties extends ThemedProperties, InputProperties,
placeholder?: string;
value?: string;
shouldFocus?: boolean;
pattern?: string | RegExp;
autocomplete?: string;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should make this a boolean and then reflect the right value depending on true or false (which would mean it needs to be in properties list for the custom element def too.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Urgh

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

boolean | string?

@@ -33,6 +33,8 @@ export interface TextInputProperties extends ThemedProperties, InputProperties,
placeholder?: string;
value?: string;
shouldFocus?: boolean;
pattern?: string | RegExp;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think we should a regular expression on the interface?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do because it's easier to catch RegExp errors in editors using RegExp syntax than in strings

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does I guess, but then it has to be a property for the custom elements, but it would be awesome if it was just an attribute. If you keep RegExp on the interface, you are going to have to implement a custom diff. Because the instance's expression can be changed but it would not trigger a re-render.

@agubler
Copy link
Member

agubler commented Oct 4, 2018

@bryanforbes uh oh @smhigley has conflicted you! 💃

@bryanforbes bryanforbes force-pushed the text-input-attributes branch from f73ce49 to 52906c9 Compare October 4, 2018 17:53
@bryanforbes bryanforbes merged commit c07301a into dojo:master Oct 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants