Skip to content

Commit

Permalink
3.0.3
Browse files Browse the repository at this point in the history
- Fixed issue that prevented id selectors from allowing dots in the string.
- Fixed issue that prevented the clear field from dispatching an input event.
  • Loading branch information
kethinov committed Jun 17, 2023
1 parent 0c976ab commit bed2d4b
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 33 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@

- Put your changes here...

## 3.0.3

- Fixed issue that prevented id selectors from allowing dots in the string.
- Fixed issue that prevented the clear field from dispatching an input event.

## 3.0.2

- Added support for a single checkbox rather than a group of checkboxes.
Expand Down
36 changes: 18 additions & 18 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "semantic-forms",
"description": "Semantic Forms",
"author": "Eric Newport <[email protected]>",
"version": "3.0.2",
"version": "3.0.3",
"files": [
"semanticForms.css",
"semanticForms.js",
Expand Down
24 changes: 12 additions & 12 deletions semanticForms.html
Original file line number Diff line number Diff line change
Expand Up @@ -114,20 +114,20 @@ <h1>Semantic Forms</h1>
<dd><textarea id="prefilledtextarea" name="prefilledtextarea" rows="5" cols="50" placeholder="e.g. He just kept talking in one incredibly unbroken sentence moving from topic to topic so that no one had a chance to interrupt it was really quite hypnotic.">Some prefilled content...</textarea></dd>
</dl>

<input type="submit" name="submit" value="Non-grouped submit button">
<input type="submit" name="button1" value="Non-grouped submit button">
<input type="reset" name="reset" value="Another one">

<p>Flexbox button layout pattern with two submit buttons:</p>
<menu>
<li><button type="submit" name="submit">Button 1</button></li>
<li><button type="reset" name="reset">Button 2</button></li>
<li><button type="submit" name="button1">Button 1</button></li>
<li><button type="reset" name="button2">Button 2</button></li>
</menu>

<p>Flexbox button layout pattern with three submit buttons:</p>
<menu>
<li><button type="submit" name="submit">Button 1</button></li>
<li><button type="reset" name="reset">Button 2</button></li>
<li><input type="submit" name="submit" value="Button 3"></li>
<li><button type="submit" name="button1">Button 1</button></li>
<li><button type="reset" name="button2">Button 2</button></li>
<li><input type="submit" name="button3" value="Button 3"></li>
</menu>
</fieldset>
</form>
Expand Down Expand Up @@ -226,20 +226,20 @@ <h1>Semantic Forms</h1>
<dd><textarea id="low-flow-prefilledtextarea" name="low-flow-prefilledtextarea" rows="5" cols="50" placeholder="e.g. He just kept talking in one incredibly unbroken sentence moving from topic to topic so that no one had a chance to interrupt it was really quite hypnotic.">Some prefilled content...</textarea></dd>
</dl>

<input type="submit" name="submit" value="Non-grouped submit button">
<input type="submit" name="button1" value="Non-grouped submit button">
<input type="reset" name="reset" value="Another one">

<p>Flexbox button layout pattern with two submit buttons:</p>
<menu>
<li><button type="submit" name="submit">Button 1</button></li>
<li><button type="reset" name="reset">Button 2</button></li>
<li><button type="submit" name="button1">Button 1</button></li>
<li><button type="reset" name="button2">Button 2</button></li>
</menu>

<p>Flexbox button layout pattern with three submit buttons:</p>
<menu>
<li><button type="submit" name="submit">Button 1</button></li>
<li><button type="reset" name="reset">Button 2</button></li>
<li><input type="submit" name="submit" value="Button 3"></li>
<li><button type="submit" name="button1">Button 1</button></li>
<li><button type="reset" name="button2">Button 2</button></li>
<li><input type="submit" name="button3" value="Button 3"></li>
</menu>
</fieldset>
</form>
Expand Down
6 changes: 4 additions & 2 deletions semanticForms.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ window.semanticForms = function () {
dl.classList.add('floatLabelForm')
}
if (input.parentNode.parentNode.id && (type === 'checkbox' || type === 'radio')) {
label = document.querySelector('label[data-for=' + input.parentNode.parentNode.id + ']')
label = document.querySelector('label[data-for=' + input.parentNode.parentNode.id.replace(/\./g, '\\.') + ']')
} else {
label = document.querySelector('label[for=' + input.id + ']')
label = document.querySelector('label[for=' + input.id.replace(/\./g, '\\.') + ']')
}
labelHTML = label.innerHTML
if (type === 'checkbox' || type === 'radio') {
Expand Down Expand Up @@ -126,6 +126,8 @@ window.semanticForms = function () {
clearfieldHorizontalOffset + clearfieldVerticalOffset > e.clientY - el.getBoundingClientRect().top
) {
el.value = ''
el.dispatchEvent(new Event('input'))
el.form.dispatchEvent(new Event('input'))
el.classList.remove('x')
el.classList.remove('onX')
}
Expand Down

0 comments on commit bed2d4b

Please sign in to comment.