-
Notifications
You must be signed in to change notification settings - Fork 66
Expand file tree
/
Copy pathEnrichedTextInputShadowNode.cpp
More file actions
33 lines (26 loc) · 1.24 KB
/
Copy pathEnrichedTextInputShadowNode.cpp
File metadata and controls
33 lines (26 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include "EnrichedTextInputShadowNode.h"
#include <react/renderer/core/LayoutContext.h>
namespace facebook::react {
extern const char EnrichedTextInputComponentName[] = "EnrichedTextInputView";
void EnrichedTextInputShadowNode::setMeasurementsManager(
const std::shared_ptr<EnrichedTextInputMeasurementManager>&
measurementsManager) {
ensureUnsealed();
measurementsManager_ = measurementsManager;
}
// Mark layout as dirty after state has been updated
// Once layout is marked as dirty, `measureContent` will be called in order to recalculate layout
void EnrichedTextInputShadowNode::dirtyLayoutIfNeeded() {
const auto state = this->getStateData();
const auto counter = state.getForceHeightRecalculationCounter();
if (forceHeightRecalculationCounter_ != counter) {
forceHeightRecalculationCounter_ = counter;
dirtyLayout();
}
}
Size EnrichedTextInputShadowNode::measureContent(
const LayoutContext &layoutContext,
const LayoutConstraints &layoutConstraints) const {
return measurementsManager_->measure(getSurfaceId(), getTag(), getConcreteProps(), layoutConstraints);
}
} // namespace facebook::react