Skip to content

Commit

Permalink
Update comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mj12albert committed Aug 11, 2023
1 parent 4009cdc commit c5ffe59
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
6 changes: 3 additions & 3 deletions packages/mui-material-next/src/InputBase/InputBase.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// TODO: un-skip skipped tests if any
/* eslint-disable mocha/no-skipped-tests */
import * as React from 'react';
import PropTypes from 'prop-types';
Expand Down Expand Up @@ -293,7 +292,8 @@ describe('<InputBase />', () => {
});
});

// TODO: requires material-next/FormControl
// TODO: unskip and refactor when integrating material-next/FormControl

describe.skip('with FormControl', () => {
it('should have the formControl class', () => {
const { getByTestId } = render(
Expand Down Expand Up @@ -645,7 +645,7 @@ describe('<InputBase />', () => {
});

describe('prop: focused', () => {
xit('should render correct border color with `ThemeProvider` imported from `@emotion/react`', function test() {
it.skip('should render correct border color with `ThemeProvider` imported from `@emotion/react`', function test() {
if (/jsdom/.test(window.navigator.userAgent)) {
this.skip();
}
Expand Down
18 changes: 10 additions & 8 deletions packages/mui-material-next/src/InputBase/InputBase.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ const InputBase = React.forwardRef(function InputBase<
renderSuffix,
required,
rows,
size,
size: sizeProp,
slotProps = {},
slots = {},
startAdornment,
Expand All @@ -296,7 +296,7 @@ const InputBase = React.forwardRef(function InputBase<

const { current: isControlled } = React.useRef(value != null);

// TODO: integrate FormControl
// TODO: integrate material-next/FormControl
const muiFormControl = useFormControl();

/*
Expand All @@ -320,7 +320,7 @@ const InputBase = React.forwardRef(function InputBase<
const onFilled = muiFormControl && muiFormControl.onFilled;
const onEmpty = muiFormControl && muiFormControl.onEmpty;

// TODO: needs FormControl & Outlined/FilledInput
// TODO: needs material-next/FormControl & material-next/Outlined|FilledInput
const checkDirty = React.useCallback(
(obj: any) => {
if (isFilled(obj)) {
Expand Down Expand Up @@ -392,7 +392,8 @@ const InputBase = React.forwardRef(function InputBase<
const {
getRootProps,
getInputProps,
focused,
focused: focusedState,
// TODO: what if this `formControlContext` is completely ignored and the component uses a completely separate one similar to Joy
// formControlContext,
error: errorState,
disabled: disabledState,
Expand All @@ -410,18 +411,19 @@ const InputBase = React.forwardRef(function InputBase<
inputRef: inputRefProp,
});

// TODO: integrate ownerState properties with material-next/FormControl: color, disabled, error, focused, hiddenLabel, size
const ownerState = {
...props,
color: colorProp,
color: colorProp || 'primary',
disabled: disabledState,
endAdornment,
error: errorState,
focused,
focused: focusedState,
formControl: muiFormControl,
fullWidth,
hiddenLabel: false, // TODO: FormControl integration
hiddenLabel: false, // TODO: material-next/FormControl integration
multiline,
// size: fcs.size,
size: sizeProp,
startAdornment,
type,
};
Expand Down

0 comments on commit c5ffe59

Please sign in to comment.