Skip to content

Commit

Permalink
fix: FEEL text fields
Browse files Browse the repository at this point in the history
  • Loading branch information
abdul99ahad committed Feb 25, 2025
1 parent 9c49e70 commit e5a0c32
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/components/entries/FEEL/Feel.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ function FeelTextfieldComponent(props) {
label,
hostLanguage,
onInput,
onBlur,
onError,
placeholder,
feel,
Expand Down Expand Up @@ -130,6 +131,13 @@ function FeelTextfieldComponent(props) {
}
};

const handleOnBlur = e => {
if (onBlur) {
onBlur(e);

Check warning on line 136 in src/components/entries/FEEL/Feel.js

View check run for this annotation

Codecov / codecov/patch

src/components/entries/FEEL/Feel.js#L136

Added line #L136 was not covered by tests
}
setLocalValue(e.target.value.trim());
};

const handleLint = useStaticCallback((lint = []) => {

const syntaxError = lint.some(report => report.type === 'Syntax Error');
Expand Down Expand Up @@ -256,6 +264,7 @@ function FeelTextfieldComponent(props) {
{ ...props }
popupOpen={ popuOpen }
onInput={ handleLocalInput }
onBlur={ handleOnBlur }
contentAttributes={ { 'id': prefixId(id), 'aria-label': label } }
value={ localValue }
ref={ editorRef }
Expand Down
21 changes: 21 additions & 0 deletions test/spec/components/Feel.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1871,6 +1871,27 @@ describe('<FeelField>', function() {
});


it('should have no trailing spaces', async function() {

// given
const result = createFeelField({ container });

const input = domQuery('.bio-properties-panel-input', result.container);

// when
changeInput(input, 'foo ');

input.focus();
input.blur();

// then
await waitFor(() => {
expect(input.value).to.equal('foo');
});

});


describe('#isEdited', function() {

it('should NOT be edited', function() {
Expand Down

0 comments on commit e5a0c32

Please sign in to comment.